We are about to switch to a new forum software. Until then we have removed the registration on this forum.
hello Everyone,
we are trying to use the rotate function in shapes 3D library by quarks.
The problem when we use time in rotate function it continuously rotate till it gets to the final position. we would like it to go to that position in One rotation.
the second problem is we are trying to use box method and we want to get the box local variables like box up vector and face center in short Box properties.
I hope you guys can gives a quick tutorial or something we can use. ultimately we are using shapes 3d library because we would like to use it with rigid bodies library.
thanks!
have a great day!
Answers
There are 5 rotateBy methods, 6 rotateTo methods as well as rotateX, rotateY and rotateZ. Some of these methods give you the option to automatically rotate the shape based on a delay and rotation time provided by the user. Some methods rotate the shape immediately by/to values provided the user. Look at the reference (comes with the library) for the Shape3D class.
In the shapes local coordinate system, the 'up' vector is always [0,1,0]. Movement and rotation a shape is done by moving and rotating the local coordinate system. It is not done by recalculating the vertices position in the 'world' coordinate system. You would have to get the angle between the local [0,1,0] and the world [0,1,0] to get close to what you want.
Thank you for responding very quickly.
we are now trying to use time , rotation and move. But we cannot seem to have the right approach . When we use update function ( in our class) in keyPressed() it works , but it doesn't work in main sketch draw function.
Eventually we will you collision detection with bRigid , is that possible to use your box class with bRigid or any other physics library.
Here is our code so far:
Thank you very much for your help and quick response.
To format code correctly in the forum, first select the code and click on the C button or press Ctrl+k . In this instance I have done it for you.
The PeasyCam library moves the view point around a fixed point in world space. It does not affect the relationship between the world space and the shapes local coordinate space. In other words PeasyCam does not rotate or move the shape.
I don't know the answer to that. Perhaps someone else might.
I am looking for some code similar to what you have, except that it uses the Shapes3D library and the Box command to enable to use of more parameters. If anybody knows of any samples that do just what this code does, a box with 6 different colored sides and uses PEasyCam camera and rotation, please let me know about the sample.
THANKS to EVERYONE for your help