三个js对象的单位是什么? [英] what is the unit for the Three js objects?

查看:32
本文介绍了三个js对象的单位是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

var camera = new THREE.PerspectiveCamera(
    35,         // Field of view
    800 / 640,  // Aspect ratio
    .1,         // Near
    10000       // Far
);

var cube = new THREE.Mesh(
    new THREE.CubeGeometry( 5, 5, 5 ),
    new THREE.MeshLambertMaterial( { color: 0xFF0000 } )
);

在相机中,Near 和 Far 参数的单位是什么.

In camera, what is the unit for Near and Far parameters.

在Cube中CubeGeometry的参数单位是什么

In Cube what is the unit of the parameters for CubeGeometry

请指向我可以找到有关详细信息的网址

Please point me to the url where, i can find details about

对象空间-(用于绘制对象的局部轴)世界空间-(全球轴)

Object space - (the local axis used to draw an object) World space - (the global axis)

推荐答案

很确定这些参数是 OpenGL 中的单位.如果你看 OpenGL 红皮书,对于第 3 章中的每一个

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:

上一段提到了英寸和毫米——做这些真的和OpenGL有什么关系吗?答案是,一句话,不.投影和其他变换本质上是无单位的.如果您想将近剪裁平面和远剪裁平面视为位于1.0 和 20.0 米、英寸、公里或里格,由您决定.唯一的规则是你必须使用一致的单位测量.然后按比例绘制生成的图像.

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.

这篇关于三个js对象的单位是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆