@@ -22,41 +22,83 @@ Eidolon is a Minecraft skin renderer written in Rust. It can render a 3D model o
2222
2323## Build and Run
2424
25- 1 . Clone the repository:
25+ 1 . Clone the repository:
2626 ``` bash
2727 git clone https://github.com/bingling-sama/SkinViewer.git
2828 cd SkinViewer
2929 ```
3030
31- 2. Run the project :
31+ 2. Run with CLI subcommands :
3232
33- To render and save the image directly:
34- ` ` ` bash
35- cargo run -- [OPTIONS] [FILENAME]
36- ` ` `
33+ # ## Render 3D Skin Image
3734
38- ** Arguments:**
39- - ` [FILENAME]` (optional): Output image filename. Defaults to ` output.png` .
35+ Render a Minecraft skin as a 3D image.
4036
41- ** Options:**
42- - ` --width < WIDTH> ` : Output image width. Defaults to ` 800` .
43- - ` --height < HEIGHT> ` : Output image height. Defaults to ` 600` .
44- - ` --texture < TEXTURE> ` : Path to the PNG texture file. Defaults to ` resources/player.png` .
45- - ` --yaw < YAW> ` : Camera yaw. Defaults to ` 20.0` .
46- - ` --pitch < PITCH> ` : Camera pitch. Defaults to ` 20.0` .
47- - ` --scale < SCALE> ` : Camera scale. Defaults to ` 1.0` .
37+ ` ` ` bash
38+ cargo run -- render [OPTIONS]
39+ ` ` `
4840
49- ** Examples:**
50- ` ` ` bash
51- # Save with default settings
52- cargo run
41+ ** Options:**
42+ - ` --filename < FILENAME> ` : Output image filename (default: ` output.png` )
43+ - ` --width < WIDTH> ` : Output image width (default: ` 800` )
44+ - ` --height < HEIGHT> ` : Output image height (default: ` 600` )
45+ - ` --texture < TEXTURE> ` : PNG skin file path (default: ` resources/bingling_sama.png` )
46+ - ` --skin-type < SkinType> ` : Skin type (` Steve` or ` Alex` ), required
47+ - ` --yaw < YAW> ` : Camera yaw (default: ` 180.0` )
48+ - ` --pitch < PITCH> ` : Camera pitch (default: ` 90.0` )
49+ - ` --scale < SCALE> ` : Camera scale (default: ` 1.0` )
50+ - ` --head-yaw < ANGLE> ` : Head yaw (default: ` 90.0` )
51+ - ` --head-pitch < ANGLE> ` : Head pitch (default: ` 90.0` )
52+ - ` --left-arm-roll < ANGLE> ` : Left arm roll (default: ` 90.0` )
53+ - ` --left-arm-pitch < ANGLE> ` : Left arm pitch (default: ` 0.0` )
54+ - ` --right-arm-roll < ANGLE> ` : Right arm roll (default: ` 90.0` )
55+ - ` --right-arm-pitch < ANGLE> ` : Right arm pitch (default: ` 0.0` )
56+ - ` --left-leg-pitch < ANGLE> ` : Left leg pitch (default: ` 90.0` )
57+ - ` --right-leg-pitch < ANGLE> ` : Right leg pitch (default: ` 90.0` )
5358
54- # Specify output filename
55- cargo run -- my_skin.png
59+ ** Example:**
60+ ` ` ` bash
61+ cargo run -- render --filename my_skin.png --texture resources/bingling_sama.png --skin-type Steve --width 1024 --height 768 --yaw 180 --pitch 90 --scale 1.2
62+ ` ` `
5663
57- # Save with custom size and camera settings
58- cargo run -- my_skin.png --width 1024 --height 768 --yaw 30 --pitch -15 --scale 1.2
59- ` ` `
64+ # ## Convert Single-layer Skin to Double-layer
65+
66+ Convert a classic single-layer Minecraft skin to double-layer format.
67+
68+ ` ` ` bash
69+ cargo run -- convert < INPUT> < OUTPUT>
70+ ` ` `
71+ - ` < INPUT> ` : Path to the single-layer skin PNG file
72+ - ` < OUTPUT> ` : Path to save the converted double-layer PNG file
73+
74+ ** Example:**
75+ ` ` ` bash
76+ cargo run -- convert old_skin.png new_skin.png
77+ ` ` `
78+
79+ # # Library Usage
80+
81+ Eidolon can also be used as a Rust library for Minecraft skin rendering and image generation.
82+
83+ # ## Example
84+
85+ ` ` ` rust
86+ use skinviewer::{Renderer, Character, Camera};
87+
88+ let renderer = Renderer::new ();
89+ let mut character = Character::new ();
90+ // character.load_skin(" path/to/skin.png" );
91+ let camera = Camera::new ();
92+ renderer.render_to_image(& character, & camera, " output.png" , (800, 600));
93+ ` ` `
94+
95+ # ## Main Components
96+
97+ - ` Renderer` : Handles the rendering process and output.
98+ - ` Character` : Represents the Minecraft player model and skin.
99+ - ` Camera` : Controls the viewpoint, yaw, pitch, and scale.
100+
101+ See the source code and module docs for advanced usage, such as custom poses, camera settings, and texture loading.
60102
61103# # Dependencies
62104
0 commit comments