Skip to content

Commit 0df5ecf

Browse files
committed
🔖 fix: update version to 0.0.1-alpha and refine README instructions
1 parent ea46efd commit 0df5ecf

File tree

6 files changed

+69
-42
lines changed

6 files changed

+69
-42
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "eidolon"
3-
version = "0.1.0"
3+
version = "0.0.1-alpha"
44
edition = "2021"
55

66
[lib]

README.md

Lines changed: 66 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -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

src/lib.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,6 @@ Minecraft 皮肤渲染器库
88
- 离屏渲染
99
1010
# 示例
11-
12-
```rust
13-
use skinviewer::{Renderer, Character, Camera};
14-
15-
let renderer = Renderer::new();
16-
let mut character = Character::new();
17-
let camera = Camera::new();
18-
// character.load_skin...
19-
renderer.render_to_image(&character, &camera, "output.png", (800, 600));
20-
```
2111
*/
2212

2313
pub mod utils;

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ enum Command {
3838
texture: String,
3939

4040
/// 皮肤类型
41-
#[arg(long, value_enum, default_value_t = SkinType::Slim)]
41+
#[arg(long, value_enum)]
4242
skin_type: SkinType,
4343

4444
/// 摄像机Yaw

src/texture.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ impl Texture {
4242
///
4343
/// # 示例
4444
///
45-
/// ```rust
46-
/// use skinviewer::texture::Texture;
47-
///
48-
/// let texture = Texture::load_from_file(&display, "resources/player.png")?;
49-
/// ```
5045
pub fn load_from_file(
5146
display: &Headless,
5247
path: &str,

0 commit comments

Comments
 (0)