Prev: Last chance for GR8 in the US conference $100 discount! Register now for the only Groovy, Grails, Griffon dedicated event in the US!
Next: Embedded Industry Expert Opinions Needed
From: NickPick on 3 Mar 2010 12:12 How can I transform an object which I loaded with a loader as below? What is the code when I want to move it to (5,5,5)? thanks ObjectFile f = new ObjectFile(); Scene loadedShip = null; try { loadedShip = f.load("C:/Users/Nicolas/Documents/ NetBeansProjects/3dGame/src/Gamestar/obj.obj"); } catch (FileNotFoundException e) { System.err.println(e); System.exit(1); } catch (ParsingErrorException e) { System.err.println(e); System.exit(1); } catch (IncorrectFormatException e) { System.err.println(e); System.exit(1); } // set colors Color3f lColor1 = new Color3f(0.7f, 0.7f, 0.7f); Vector3f lDir1 = new Vector3f(-1.0f, -1.0f, -1.0f); Color3f alColor = new Color3f(0.2f, 0.2f, 0.2f); // set light AmbientLight aLgt = new AmbientLight(alColor); BoundingSphere bounds = new BoundingSphere(new Point3d(0.0, 2.0, 0.0), 100.0); aLgt.setInfluencingBounds(bounds); DirectionalLight lgt1 = new DirectionalLight(lColor1, lDir1); lgt1.setInfluencingBounds(bounds); objRoot.addChild(aLgt); objRoot.addChild(lgt1); Transform3D tr = new Transform3D(); tr.set(new Vector3f(0.3f, 0.2f, 0.2f)); objRoot.addChild(loadedShip.getSceneGroup());
From: Jeff Higgins on 4 Mar 2010 07:04 NickPick wrote: > How can I transform an object which I loaded with a loader as below? > What is the code when I want to move it to (5,5,5)? > > thanks Here's another place to ask for help with the Java 3D related: <http://forums.java.net/jive/forum.jspa?forumID=70>
From: blabla on 5 Mar 2010 07:22
> How can I transform an object which I loaded with a loader as below? > What is the code when I want to move it to (5,5,5)? > > Transform3D tr = new Transform3D(); > tr.set(new Vector3f(0.3f, 0.2f, 0.2f)); You already translated it by (0.3,0.2,0.2), did you try to change it to (5,5,5)? |