Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (408)
games submitted by our members
Games in WIP (293)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Transform3D rotation question..(plus new question)  (Read 1014 times)
0 Members and 1 Guest are viewing this topic.
Offline ArchangelMorph

Senior Newbie




Java games rock!


« Posted 2005-04-07 14:11:46 »

How do I set the Rotation of a Transform3D Obj back to the default rotation (I think they call it the identity matrix?)

For example,

If I have a program which allows me to rotate a cube primitive by mul Transform3D to the Transform3D Obj of the cube, then is there a method I can call to make the Transform3D Obj of the cube return to the Default rotation (of 'no' rotation)..?

- ArchangelMorph -
Offline shawnkendall

Senior Member




Apathy Error: Don't bother striking any key.


« Reply #1 - Posted 2005-04-07 20:10:05 »

Well if you really want identity, it's just setIdentity(), see the JavaDocs.

But if it is some "default" location (identity would be the origin, with world aligned rotation (i.e. no rotation) and unit scale ) that would be the original transform matrix.  You would need to store that at load or creation time and make your own method to restore those values (i.e. set()).

I suggest the JavaDocs and the Java3D tutorial for more info.

Shawn Kendall
Full Sail Real World Education
Immediate Mode Interactive, LLC
<A HREF="http://cosmic-game-engine.blogspot.com/">Cosmic Game Engine Dev Journal</a>
Offline ArchangelMorph

Senior Newbie




Java games rock!


« Reply #2 - Posted 2005-04-07 20:37:20 »

Is the identity the default transform to the parent node?

Because if so then that should be ok for me..?

- ArchangelMorph -
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ArchangelMorph

Senior Newbie




Java games rock!


« Reply #3 - Posted 2005-04-08 17:23:39 »

Also I have some more questions on a related topic..

I want to rotate a 3D object by a certain degree (lets say 30 degrees about Y)..

I figured I could use the setEuler() method and specify the Y rotation to the specific value but I'm not sure how I would assign the value exactly..

Does the method deal with rotations in radians or in degrees and if I wanted to specify the rotation as float's rather than double's then is that also possible?

Also is there a Java3D method to convert degrees to radians?

Hope someone can help..

- ArchangelMorph -
Offline shawnkendall

Senior Member




Apathy Error: Don't bother striking any key.


« Reply #4 - Posted 2005-04-08 21:38:55 »

I believe that is in radians, but the JavaDocs for Java3D should say...
http://javadesktop.org/java3d/javadoc/1.3.2/index.html

The degree-to-radians and back are in java.lang.Math, again see the JavaDocs
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Math.html
and
http://java.sun.com/j2se/1.5.0/docs/api/

http://java.sun.com/products/java-media/3D/collateral/

Shawn Kendall
Full Sail Real World Education
Immediate Mode Interactive, LLC
<A HREF="http://cosmic-game-engine.blogspot.com/">Cosmic Game Engine Dev Journal</a>
Offline NewbTon

Junior Member




Odejava games rock!


« Reply #5 - Posted 2005-07-20 05:08:27 »

I suggest the JavaDocs and the Java3D tutorial for more info.
Both which is useless..
Offline Jeff

JGO Coder




Got any cats?


« Reply #6 - Posted 2005-07-29 23:44:36 »

I suggest the JavaDocs and the Java3D tutorial for more info.
Both which is useless..

Then I suggest a Linear Algebra class.

Really, the concept of an identity matrix is basic math.   If you are having trouble with the docs I'd guess ist because you dont have the background to follow them.

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Get high quality music tracks for your game!

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (115 views)
2013-05-17 21:29:12

alaslipknot (123 views)
2013-05-16 21:24:48

gouessej (152 views)
2013-05-16 00:53:38

gouessej (145 views)
2013-05-16 00:17:58

theagentd (159 views)
2013-05-15 15:01:13

theagentd (143 views)
2013-05-15 15:00:54

StreetDoggy (187 views)
2013-05-14 15:56:26

kutucuk (211 views)
2013-05-12 17:10:36

kutucuk (210 views)
2013-05-12 15:36:09

UnluckyDevil (215 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!
Page created in 0.094 seconds with 22 queries.