Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (538)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (600)
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 1425 times)
0 Members and 1 Guest are viewing this topic.
Offline ArchangelMorph

Senior Newbie




Java games rock!


« Posted 2005-04-07 12: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 Devvie





« Reply #1 - Posted 2005-04-07 18: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
Cosmic Interactive, LLC
http://www.facebook.com/BermudaDash
Offline ArchangelMorph

Senior Newbie




Java games rock!


« Reply #2 - Posted 2005-04-07 18: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 15: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 Devvie





« Reply #4 - Posted 2005-04-08 19: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
Cosmic Interactive, LLC
http://www.facebook.com/BermudaDash
Offline NewbTon

Junior Devvie




Odejava games rock!


« Reply #5 - Posted 2005-07-20 03: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 21:44:36 »


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.

 

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

The first screenshot will be displayed as a thumbnail.

rwatson462 (29 views)
2014-12-15 09:26:44

Mr.CodeIt (20 views)
2014-12-14 19:50:38

BurntPizza (40 views)
2014-12-09 22:41:13

BurntPizza (75 views)
2014-12-08 04:46:31

JscottyBieshaar (37 views)
2014-12-05 12:39:02

SHC (50 views)
2014-12-03 16:27:13

CopyableCougar4 (47 views)
2014-11-29 21:32:03

toopeicgaming1999 (113 views)
2014-11-26 15:22:04

toopeicgaming1999 (100 views)
2014-11-26 15:20:36

toopeicgaming1999 (30 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
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!