Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何加载模型后对模型进行平移 #9

Open
XunZhan opened this issue Oct 6, 2021 · 1 comment
Open

如何加载模型后对模型进行平移 #9

XunZhan opened this issue Oct 6, 2021 · 1 comment

Comments

@XunZhan
Copy link

XunZhan commented Oct 6, 2021

你好,

由于自己的模型头发太高,点头动作会导致呆毛有一部分被canvas截断,请问如何设置加载模型时或显示模型时,将模型向下偏移一段距离?谢谢你!

@Dragon1573
Copy link

Dragon1573 commented May 25, 2024

概述

@XunZhan - 我的模型是脖子以上全没了😭暂时没能找到设置位置或者缩小模型的配置

image


解决方案

模型是在 <canvas /> 中被渲染的,需要调整模型本身。

以我使用的模型为例,需要针对性调整 layout 下的4个参数。

  • center_x 调整模型在 <canvas /> 中的水平偏移
  • center_y 调整模型在 <canvas /> 中的垂直偏移
  • widthheight 猜测 是调整模型的缩放比例(这里的 2 可能表示 200%)
{
    "posted": "Dreamer-Paul",
    "version": "Live2DViewerEX Config 1.0",
    "model": "sagiri.moc",
    "textures": [
        "textures/texture_00.png",
        "textures/texture_01.png"
    ],
    "layout": {
        "center_x": 0,
        "center_y": -0.3,
        "width": 2,
        "height": 2
    },
    "motions": {
        "tap": [
            {
                "file": "motions/tap/c.mtn"
            }
        ],
        "idle": [
            {
                "file": "motions/idle/idle_01.mtn"
            },
            {
                "file": "motions/idle/idle_02.mtn"
            },
            {
                "file": "motions/idle/idle_03.mtn"
            },
            {
                "file": "motions/idle/idle_04.mtn"
            }
        ]
    },
    "physics": "physics.json"
}

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants