A question regarding rotation of meshes

All topics about ZGameEditor goes here.

Moderator: Moderators

Post Reply
jobromedia
Posts: 5
Joined: Sun Jan 09, 2011 3:52 am

A question regarding rotation of meshes

Post 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.
User avatar
Kjell
Posts: 1891
Joined: Sat Feb 23, 2008 11:15 pm

Post 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
Attachments
Example.zgeproj
(838 Bytes) Downloaded 465 times
Post Reply