what is the unit for the Three js objects?

前端 未结 2 711
春和景丽
春和景丽 2021-01-17 23:05
var camera = new THREE.PerspectiveCamera(
    35,         // Field of view
    800 / 640,  // Aspect ratio
    .1,         // Near
    10000       // Far
);

var cub         


        
相关标签:
2条回答
  • 2021-01-17 23:17

    Pretty sure these parameters are units in OpenGL. If you look at the OpenGL red book, for each in chapter 3

    http://www.glprogramming.com/red/chapter03.html

    There's a short paragraph here:

    The preceding paragraph mentions inches and millimeters - do these really have anything to do with OpenGL? The answer is, in a word, no. The projection and other transformations are inherently unitless. If you want to think of the near and far clipping planes as located at 1.0 and 20.0 meters, inches, kilometers, or leagues, it's up to you. The only rule is that you have to use a consistent unit of measurement. Then the resulting image is drawn to scale.

    So to answer your question, the units are whatever you think they should be, they are a purely relative scale.

    0 讨论(0)
  • 2021-01-17 23:17

    The official answer is that ThreeJS uses SI units for all measures, see here:

    https://github.com/mrdoob/three.js/issues/6259

    0 讨论(0)
提交回复
热议问题