It really confused me that Ogre::MeshManager::createPlane() method takes both a plane with a normal vector and an up vector as 'upVector'. When you already know the upward normal vector due to the plane the method takes, what's the use of 'upVector' parameter? I found the answer from the next linked web forum page.
'upVector' parameter is actually the V axis of the texture. The U axis of the texture is obtained by the cross product of the normal vector and the V axis vector. If 'upVector' parameter is UNIT_Z, the V axis of the texture is along the Z axis.
If 'upVector' should be UNIT_Y as you might intuitively think because of the name, the U axis can not exist so the texture can not be shown. Further, the app can crash. I think it should have been named 'vAxis' to prevent this confusion.
No comments:
Post a Comment