[INFORMATION](4/11/2024)
Cubism Editor 5.1 alpha2 is now available!
We have incorporated some of your comments and suggestions. Thank you for your comments and requests!
We will continue to welcome your feedback on alpha2.
Download/
Manual and Update History
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.