[About macOS Sequoia] (Updated October 22, 2024)
Live2D Cubism Editor 5.1.02 now supports macOS Sequoia.
Other Live2D Cubism products currently released are not guaranteed to work on macOS Sequoia.
Please refrain from upgrading macOS, as it may not operate properly.
How to use the matrix in live2d
I want to transform and scale a live2d model.
Anyone can tell me how to do get this done.
How to use the two matrix below?
deviceToScreen=new L2DMatrix44();
viewMatrix=new L2DViewMatrix();
0 ·
Comments
deviceToScreen is a matrix to transform device coordinates to screen coordinates. For example, this object is used to get the coordination from touchEvent on screen (values like 1034.27, 328.63), and translate into parameters that Live2DModel uses (typically between -1 to 1).
viewMatrix is for perspective transformation. You can change the magnification and the coordination of the camera by modifying it.
I guess you are trying to scale only the model, not the whole screen. If so, then modelMatrix declared in LAppModel would be useful. To scale the model you can use setWidth() or setHeight(). setWidth() scales according to model's width, and setHeight scales according to model's height. As these methods would not change the aspect ratio, you only need to set one of them.
Also you can set the size explicitly.
1-d. Specify the position and the size
https://sites.google.com/a/cybernoids.jp/cubism_e/sdk_tutorial/live2d_library/load_to_display/display_mode
There are three screen size 1024x768, 1136x640 and 960x640 need to adapt.
My modal canvas is 960x640. And I found it shows a little strange in 1136x640 screen size. It scale bigger a lot.