Page 1 of 1

A question regarding rotation of meshes

Posted: Sun Jan 09, 2011 4:05 am
by jobromedia
Hi! New to this forum, and ZGE, so bare with my ignorance. :D

I'm trying to set up a mesh to be rotated around, not as a game but just for my practice.

So my question is:

How do I rotate the mesh around in real time?

Oh and another obvious question: How do you map textures? Watched the videos but they didn't give me much info as a sight impaired person. A voice tells better what to do than any crappy music can hope to do. :)

Thanks in advance.

Posted: Sun Jan 09, 2011 12:09 pm
by Kjell
Hello ~

The easiest way to rotate a mesh in real-time is by using a Model. So in a project containing your mesh & bitmap follow these steps ..

1 - Add a Model component to App:Content & set the RotationVelocity property to the desired velocity.
2 - Add a RenderMesh component to Model:OnRender & set the Mesh property to your Mesh.
3 - Add a SpawnModel component to App:OnLoaded & set the Model property to your Model.

Image

Now if you would want to texture your mesh, continue with these steps.

4 - Add a Material component to App:Content.
5 - Add a MaterialTexture component to Material:Textures & set the Texture property to your Bitmap.
6 - Add a UseMaterial component in Model:OnRender & set the Material property to your Material*

*Make sure to move the UseMaterial component above RenderMesh as pictured.

Image

Attached is a example project containing these steps.

Good luck ~
K