Animated Quad

Hello together,

I´m new at jmonkey, so sorry for the noob questions :wink:

I have a quad which I want to rotate while the app is running. What is the best way to implement that?

I searched for mesh animation, but I only find examples to animate models make with blender.



thanks for your help!

Chris

I would use a custom control

You rotate your mesh’s geometry. e.g: myquadgeo.rotate(0.1f, 0.1f, 0.1f);



if you wanna do it as a loop, put it in the SimpleApplication.simpleUpdate() method.



These links might helps you :



https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:intermediate:simpleapplication



https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:scenegraph_for_dummies

Try this:



Google Code Archive - Long-term storage for Google Code Project Hosting.



Google Code Archive - Long-term storage for Google Code Project Hosting.



Google Code Archive - Long-term storage for Google Code Project Hosting.



Google Code Archive - Long-term storage for Google Code Project Hosting.



Google Code Archive - Long-term storage for Google Code Project Hosting.



and this: https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:math_for_dummies

Thank all of you for the fast replay!

I used the custom control and it rotate. But the quad rotate around on corner and not around the center. How can I fix that problem?

jMonkey is very cool, but hard to learn :wink:



Thanks

Chris

@phoebus said:
I used the custom control and it rotate. But the quad rotate around on corner and not around the center. How can I fix that problem?
jMonkey is very cool, but hard to learn ;)

The center of the quad is at its lower left corner, add it to a node, move it half its width to the left and then rotate the node. Or move the quad's vertices using the VertexBuffer. Also you mean game development there, not jMonkey :P

Thanks, great! That was it.

Normen you are right :wink:



Have a nice day!

Chris