How would I rotate all the vertices in a mesh in 3 dimensions so that the z axis would be = to a line drawn from the active camera to it's look at coordinate?
I want the camera looking down the new z axis.
rotate all vertices so mesh axis = camera axis
Re: rotate all vertices so mesh axis = camera axis
not sure if i understood what you want, but if you want fix an object to another you can use addChild
camera->setPosition(core::vector3df(0,0,0));
yourmesh->setPosition(core::vector3df(0,0,10));
camera->addChild(yourmesh);
to fix your mesh 10 units ahead from the camera in the z axis
camera->setPosition(core::vector3df(0,0,0));
yourmesh->setPosition(core::vector3df(0,0,10));
camera->addChild(yourmesh);
to fix your mesh 10 units ahead from the camera in the z axis
Re: rotate all vertices so mesh axis = camera axis
normally a camera looks at a mesh from the front down the z axis. My camera sometimes looks from a side angle. For such meshes I want to modify the vertices so that z axis indicates depth relative to the active camera. Currently z and x axis's are both partly depth and partly width some times. Which makes it difficult to order decals so they render directly on top of a sub-mesh behind them in a way that works for all meshes.
I assume I need to find a way to calculate in degrees the deviation between the camera's depth axis in and the mesh's x, y, and z axis's, and then find a function that will change the meshes vertex values and the camera coordinates so that the camera looks down the meshes new z axis with x axis now indicating width but still rendering the same scene.
I assume I need to find a way to calculate in degrees the deviation between the camera's depth axis in and the mesh's x, y, and z axis's, and then find a function that will change the meshes vertex values and the camera coordinates so that the camera looks down the meshes new z axis with x axis now indicating width but still rendering the same scene.