Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
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  
  Question about coordinate systems  (Read 3062 times)
0 Members and 1 Guest are viewing this topic.
Offline gregorypierce

Senior Duke




I come upon thee like the blue screen of death....


« Posted 2005-01-23 04:43:30 »

I'm writing a presentation comparing jME and Xith3D and while I could gather information about Xith3D with regards to putting together a related hierarchical scene structure I haven't been able to find similar for jME.

So here's the question. The scenario is drawing a simple:

sun->planet->moons

scenario. So I create a Node and attach a sphere for the sun. I create a Node and attach a sphere for the planet. I create a set of Node(s) and attach a sphere for each of the moons. I then parent them up properly to maintain the hierarcy. The question I have then is how do I specify position relative to the respective parent Node for the planet and the moons?

The sun is sitting in the middle of the graph. The planet is going to be offset from the center and I set a Vector3f() for its position when creating the sphere, but what coordinate system is that relative to?

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline Mojomonkey

Senior Duke




ooh ooh eee eeee


« Reply #1 - Posted 2005-01-23 06:19:37 »

Local settings affect a node respective to it's parent. setLocalTranslation, setLocalRotation, setLocalScale.
1  
2  
3  
4  
5  
6  
7  
8  
sun.attachChild(planet);
planet.setLocalTranslation(100, 0,0);
planet.attachChild(moon);
moon.setLocalTranslation(10, 0,0);

//sun's actual world coordinates: 0,0,0
//planet's actual world coordinates: 100, 0, 0
//moon's actual world coordinates: 110, 0, 0

Don't send a man to do a monkey's work.
Offline gregorypierce

Senior Duke




I come upon thee like the blue screen of death....


« Reply #2 - Posted 2005-01-23 13:07:30 »

Quote
Local settings affect a node respective to it's parent. setLocalTranslation, setLocalRotation, setLocalScale.
1  
2  
3  
4  
5  
6  
7  
8  
sun.attachChild(planet);
planet.setLocalTranslation(100, 0,0);
planet.attachChild(moon);
moon.setLocalTranslation(10, 0,0);

//sun's actual world coordinates: 0,0,0
//planet's actual world coordinates: 100, 0, 0
//moon's actual world coordinates: 110, 0, 0



Great thanks. Was surprised to not see a "classic" hierarchical animation example in the docs.

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline winkman

Senior Newbie




Java games !


« Reply #3 - Posted 2005-01-24 05:47:06 »

there's an example of circular animation in jmetest.TutorialGuide.HelloAnimation.
It rotates a point light and a box around a sphere using a SpatialTransformer.

Offline darkprophet

Senior Duke




Go Go Gadget Arms


« Reply #4 - Posted 2005-01-24 11:22:27 »

there is also "jmetest.renderer.TestSceneGraph" that does exactly what you are looking for Smiley

DP

Friends don't let friends make MMORPGs.

Blog | Volatile-Engine
Offline gregorypierce

Senior Duke




I come upon thee like the blue screen of death....


« Reply #5 - Posted 2005-01-24 14:29:33 »

Quote
there's an example of circular animation in jmetest.TutorialGuide.HelloAnimation.
It rotates a point light and a box around a sphere using a SpatialTransformer.



Rotation with the SpatialTransformer is far from simple unfortunately and I'm actually trying to get my head around the pivots and Quaternions of that example to make sense of them. If you want a simple "Rotate around your parent at this rate using this rotation matrix" there isn't anything simple.

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline renanse

Junior Duke




Intelligence is light to a dark world.


« Reply #6 - Posted 2005-01-24 21:49:05 »

We've got "simpler utility classes" as an item of business on the .9 slate.  I'll look at making something like what you talk about one of these utils.

Renanse  (ruh-NON-say)
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.

Longarmx (37 views)
2014-10-17 03:59:02

Norakomi (28 views)
2014-10-16 15:22:06

Norakomi (24 views)
2014-10-16 15:20:20

lcass (27 views)
2014-10-15 16:18:58

TehJavaDev (52 views)
2014-10-14 00:39:48

TehJavaDev (54 views)
2014-10-14 00:35:47

TehJavaDev (42 views)
2014-10-14 00:32:37

BurntPizza (64 views)
2014-10-11 23:24:42

BurntPizza (36 views)
2014-10-11 23:10:45

BurntPizza (77 views)
2014-10-11 22:30:10
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

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!