Hi,
I am trying to write a f1 game and i am on the beginning. I want to rotate the wheels of the car but there is a problem. Every wheel is a different model but it's center is the is the worlds' 0,0,0 coordinates and not the wheels real center (so that the wheel fits to the rest of the car model)! Do you know any way to calculate the real center so that i can make the right rotation of the wheel?
Calculate/rotate real mesh center
-
- Posts: 81
- Joined: Sat Sep 09, 2006 6:46 am
Look in your old math books for a word called average
Make sure you don't have any stray vertecies. Irrlicht uses 0,0,0 for rotation, so just relocating the mesh in a 3D editor should work. As for calculating the center, you'd do a for loop on the meshes vertecies, and average all of thier Xs, Ys, and Zs to get the centerpoint.
Make sure you don't have any stray vertecies. Irrlicht uses 0,0,0 for rotation, so just relocating the mesh in a 3D editor should work. As for calculating the center, you'd do a for loop on the meshes vertecies, and average all of thier Xs, Ys, and Zs to get the centerpoint.