This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Other JSE/JEE APIs and the fly likes Problem in adding view to Cube in java 3d Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Problem in adding view to Cube in java 3d" Watch "Problem in adding view to Cube in java 3d" New topic
Author

Problem in adding view to Cube in java 3d

Neeba Rebbaca
Ranch Hand

Joined: Oct 21, 2008
Posts: 157
I tired to add multiple cubes of size 25. I have translated the view.But still i can able to see only one cube not the others. I went wrong somewhere.But don't know where. Please help me...


>
Neeba Rebbaca
Ranch Hand

Joined: Oct 21, 2008
Posts: 157
please help me with some idea...I'm badly in need of that...
Neeba Rebbaca
Ranch Hand

Joined: Oct 21, 2008
Posts: 157
I want to draw a cubes of size 25 and in many number at different co-ordinates.These are the steps i followed.

1. Declared and initialised Virtual Universe.
2. Declared and set x,y,z for HiResCoord.
3. Declaring and passing hirescoord and virtualuniverse obj to Locale.
4. Declaring and BranchGroup(scenegraph) and adding an array of ColorCube to the branchgroup.
5. Declaring another BranchGroup(View graph).
6. Declaring an array of TransformGroup and Transform3D.
7. Inside the loop, translating to new position. The x,y values are incremented by loop.(-250,250,-1000 and -215,215,-1000). and transform3d object is added to transformgroup object. And transform3d object is inverted.
8. Declared and initialised ViewPlatform and added view graph.
9. Declared , initialised view class and add PhysicalEnvironment and PhysicalBody to it.
10. set backClipDistance for 200 and and frontClipDistance for 2.
11. And added canvas3d .
12. And added canvas3d to applet.

I tried to add two cubes at different coordinates.But they are getting overlapped.I couldn't able to trace out.Please help me solving the issue.

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Problem in adding view to Cube in java 3d