DrawableVertexPositions Range

Updated: 11/07/2019

The model vertex information that can be retrieved from Cubism Core for Native depends on the settings when output from the Editor.

The vertex information for a model refers to the XY coordinates obtained by the CubismModel::GetDrawableVertexPositions function in Framework and by the csmGetDrawableVertexPositions function in CubismCore.

First, the origin is indicated by the following values in the dialog box when saving. The origin is determined by the percentage distance from the upper-left corner to the whole model.

  • Center of model X (1)
  • Center of model Y (2)

Cubism Core for Native uses the same coordinate system representation as OpenGL. The resulting vertex values are positive when it is right above the origin and are expressed in units indicated by (5).

When dealing with right-handed coordinates, such as DirectX, the Y axis must be inverted.

If the lower left corner is localX,localY in the Editor of the origin, the output coordinates will be as follows.

  • X = (localX / (5)) – ((1) x (3))
  • Y = ((2) x (4)) – (localY / (5))

.

The range of values is as follows.

  • For the X axis, the range is from -(1) x (3) to (3) – ((1) x (3)) 
  • For the Y axis, the range is from ((2) x (4)) – (4) to (2) x (4) 
  • X(-0.5 to 0.5) Y(-0.7 to 0.7) if viewed in the upper left dialog box

.

Was this article helpful?
YesNo
Please let us know what you think about this article.