Is there a better way display numerous cubes

View: New views
3 Messages — Rating Filter:   Alert me  

Is there a better way display numerous cubes

by java3d-interest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I need to display a 3D model by using equal sized cubes.
I have done this but for large amounts of cubes (60000) I get out of memory error.
I simply use the default Box object, for each cube and translate each cube to
its required position. This was easiest.
Rendering even for smaller objects are slow.

Any ideas?
[Message sent by forum member 'likenootherufo' (likenootherufo)]

http://forums.java.net/jive/thread.jspa?messageID=281954

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@...
For additional commands, e-mail: interest-help@...


Re: Is there a better way display numerous cubes

by java3d-interest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Box uses six Shape3D for each  object. This useful to  set a different Appearance for each face.

If you don't mind to have the same appearance for all faces, you can create your own box using a single Shape3D. To do this,  create a single geometry for your "cube" and use it to create as many  Shape3D you need.

PLEASE, note you must use the *same* geometry instance for all shapes. This way you avoid memory bloat by re-using geometry. All Java3D Primitives including original Box , uses this feature called "geometry sharing"

Of course you can also reuse Appearance instances, if you have more than one box  with same appearance properties ;)

Btw, you can also increase  memory maximum size, using JVM parameter -Xmx512m or more. Of course you must have enough free memory for this.

A.
[Message sent by forum member 'aces' (aces)]

http://forums.java.net/jive/thread.jspa?messageID=282147

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@...
For additional commands, e-mail: interest-help@...


Re: Is there a better way display numerous cubes

by java3d-interest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You can also try to make one Shape3D for all the boxes. Or one Shape3D for each unique Apperance. This will increase the space used by the geometry data, compared to shared geometry. But it reduces overhead needed for each box.
[Message sent by forum member 'lamer77' (lamer77)]

http://forums.java.net/jive/thread.jspa?messageID=282190

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@...
For additional commands, e-mail: interest-help@...

LightInTheBox - Buy quality products at wholesale price