Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (777)
Games in Android Showcase (231)
games submitted by our members
Games in WIP (856)
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  
  Cannot understand how TransformGroup above ViewPlatform is updated.  (Read 4481 times)
0 Members and 1 Guest are viewing this topic.
Offline DoubleBarrel

Senior Newbie

« Posted 2009-11-12 12:33:05 »

Hi, I am a Java 3d beginner.

I am currently reading the book KJGP and doing fairly well following the examples, however there is one piece of code in chapter 15 I cannot understand clearly. The comments are my current understanding of the code. Please correct me:

private void initUserPosition()
    //get viewing platform from simple universe into vp
    ViewingPlatform vp = su.getViewingPlatform();
    //get the transform group above the viewPlatform into steerTG
    TransformGroup steerTG = vp.getViewPlatformTransform();

    //set t3d with the same value of steerTG
    Transform3D t3d = new Transform3D();

    //manipulate t3d's values to be looking at the values specified in lookAt. And invert.
    t3d.lookAt( USERPOSN, new Point3d(0,0,0), new Vector3d(0,1,0));

    //make the value of steerTG the same as the values in t3d.
  }  // end of initUserPosition()

Now my problem is -how does the change in steerTG is passed to the TransformGroup above the ViewPlatform; when in the above code, the TransformGroup above the ViewPlatform isn't updated with the values in steerTG through any methods?

Thankyou for your kindness and patience.

And Java Goes On
Offline tom
« Reply #1 - Posted 2009-11-12 17:31:08 »

steerTG IS the TransformGroup above the ViewPlatform. Changing its transform will update the position of the view.

Offline DoubleBarrel

Senior Newbie

« Reply #2 - Posted 2009-11-12 17:39:08 »

So, .getViewPlatformTransform(); returns the actual TransformGroup above the ViewPlatform, and not only a copy of its contents?

And Java Goes On
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline tom
« Reply #3 - Posted 2009-11-13 07:34:56 »


Offline DoubleBarrel

Senior Newbie

« Reply #4 - Posted 2009-11-13 16:20:58 »

Thankyou very much Tom  Grin
I understand now Roll Eyes.

And Java Goes On
Pages: [1]
  ignore  |  Print  

hadezbladez (295 views)
2018-11-16 13:46:03

hadezbladez (164 views)
2018-11-16 13:41:33

hadezbladez (295 views)
2018-11-16 13:35:35

hadezbladez (75 views)
2018-11-16 13:32:03

EgonOlsen (2156 views)
2018-06-10 19:43:48

EgonOlsen (2183 views)
2018-06-10 19:43:44

EgonOlsen (1370 views)
2018-06-10 19:43:20

DesertCoockie (1987 views)
2018-05-13 18:23:11

nelsongames (1630 views)
2018-04-24 18:15:36

nelsongames (2278 views)
2018-04-24 18:14:32
Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46 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‑
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!