Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (636)
Games in Android Showcase (178)
games submitted by our members
Games in WIP (685)
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  
  Real Time?  (Read 1171 times)
0 Members and 1 Guest are viewing this topic.
Offline Jamison

Junior Devvie

We're all idiots in one way or another.

« Posted 2006-05-03 18:24:23 »

Hey all,

I'm having a bit of trouble getting started with Java 3D... I can get a BranchGroup to render and all, rotate a cube, etc. But after the scene is compiled (BranchGroup.compile()), I can't set the Transform3D object on my TransformGroup object. Here's my code:
import java.awt.*;
import javax.swing.*;
import com.sun.j3d.utils.universe.*;
import com.sun.j3d.utils.geometry.*;

public class Test extends JFrame {
   TransformGroup cubeTG = new TransformGroup();

   public Test() {
      setSize(400, 300);

      GraphicsConfiguration gc = SimpleUniverse.getPreferredConfiguration();
      Canvas3D c = new Canvas3D(gc);

      BranchGroup scene = new BranchGroup();

      cubeTG.addChild(new ColorCube(0.4));


      SimpleUniverse su = new SimpleUniverse(c);


      while(true) {
         Transform3D t3d = new Transform3D();



   public static void main(String args[]) {
      new Test();
I recieve the following exception:
Exception in thread "main" Group: no
capability to set transform
        at Test.<init>(
        at Test.main(
If I can't set the transform on an object after the scene has been compiled, how can I render in real time (for 3D games...)?

I don't like you. Check out my site Smiley
Offline Breakfast

Senior Devvie

for great justice!

« Reply #1 - Posted 2006-05-03 22:36:54 »

You need to set ALLOW_TRANSFORM_WRITE as one of the attributes on your transformgroup before you compile it- basically compiling will allow Java3D to optimise your scene as much as possible, if it knows an object won't be moved it can perform some optimisations that it couldn't perform if the object will be moved, so you need to tell it ahead of time.

I wrote a tutorial on basic Java3D for games a few years back, I suspect it may be a little out of date by now but there will probably be some stuff there that is useful to you- you can find it here...
Offline Jamison

Junior Devvie

We're all idiots in one way or another.

« Reply #2 - Posted 2006-05-04 01:31:13 »

Alright! Thanks so much, Breakfast. It works just as I wanted it to. I'll have a look at your tutorial now too.

I don't like you. Check out my site Smiley
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

Dwinin (58 views)
2015-11-07 13:29:08

Rems19 (72 views)
2015-10-31 01:36:56

Rems19 (63 views)
2015-10-31 01:32:37

williamwoles (101 views)
2015-10-23 10:42:59

williamwoles (87 views)
2015-10-23 10:42:45

Jervac_ (102 views)
2015-10-18 23:29:12

DarkCart (128 views)
2015-10-16 00:58:11

KaiHH (112 views)
2015-10-11 14:10:14

KaiHH (148 views)
2015-10-11 13:26:18

BurntPizza (162 views)
2015-10-08 03:11:46
Rendering resources
by Roquen
2015-11-13 14:37:59

Rendering resources
by Roquen
2015-11-13 14:36:58

Math: Resources
by Roquen
2015-10-22 07:46:10

Networking Resources
by Roquen
2015-10-16 07:12:30

Rendering resources
by Roquen
2015-10-15 07:40:48

Math: Inequality properties
by Roquen
2015-10-01 13:30:46

Math: Inequality properties
by Roquen
2015-09-30 16:06:05

HotSpot Options
by Roquen
2015-08-29 11:33:11 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!