on my pc it's working > Hello, > > how do I make 2 QuadArrays in a Shape3D? > I just cant get this work, whats wrong? :-( > > [full code] > import java.applet.Applet; > import java.awt.BorderLayout; > import java.awt.event.*; > import com.sun.j3d.utils.applet.MainFrame; > import com.sun.j3d.utils.universe.*; > import javax.media.j3d.*; > import javax.vecmath.*; > > public class Quads extends Applet { > public BranchGroup createSceneGraph() { > BranchGroup bg = new BranchGroup(); > TransformGroup tg = new TransformGroup(); > bg.addChild(tg); > > QuadArray qa = new QuadArray (8, QuadArray.COORDINATES | > QuadArray.COLOR_3); > qa.setCoordinate (0, new Point3f (-1.0f, 1.0f, -5.0f )); > qa.setCoordinate (1, new Point3f (1.0f, 1.0f, -5.0f )); > qa.setCoordinate (2, new Point3f (1.0f, 2.0f, -5.0f )); > qa.setCoordinate (3, new Point3f (-1.0f, 2.0f, -5.0f )); > qa.setCoordinate (4, new Point3f (-1.0f, -2.0f, -5.0f )); > qa.setCoordinate (5, new Point3f (1.0f, -2.0f, -5.0f )); > qa.setCoordinate (6, new Point3f (1.0f, -1.0f, -5.0f )); > qa.setCoordinate (7, new Point3f (-1.0f, -1.0f, -5.0f )); > > Color3f c = new Color3f (0.4f, 0.9f, 0.4f); > qa.setColor (0, c); > > tg.addChild(new Shape3D (qa)); > bg.compile(); > return bg; > } > public Quads() { > setLayout(new BorderLayout()); > Canvas3D c = new > Canvas3D(SimpleUniverse.getPreferredConfiguration( )); > add("Center", c); > BranchGroup scene = createSceneGraph(); > SimpleUniverse u = new SimpleUniverse(c); > u.getViewingPlatform().setNominalViewingTransform(); > u.addBranchGraph(scene); > } > public static void main(String[] args) { > new MainFrame(new Quads(), 256, 256); > } > } > [/code] > > _________________________________________________________________ > Help STOP SPAM with the new MSN 8 and get 2 months FREE* > http://join.msn.com/?page=features/junkmail > > =========================================================================== > To unsubscribe, send email to [EMAIL PROTECTED] and include in the > body > of the message "signoff JAVA3D-INTEREST". For general help, send email to > [EMAIL PROTECTED] and include in the body of the message "help". >
=========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".