www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: Bart on October 25, 2003, 01:12:27 pm

Title: Octree question
Post by: Bart on October 25, 2003, 01:12:27 pm
I have a function that adds cubes to a world. I make one cube, I clone it, and I translate it. Then, I add the cubes to the world. But now i can't make an octree. I tried to use mergeObject but the translations aren't copied. Do you have an idea to make the world faster? (Sorry for my bad english  :oops: )
Title: Octree question
Post by: EgonOlsen on October 25, 2003, 04:22:04 pm
You may ignore the problem...the culling won't be performed using the octree nodes then but the objects' bounding boxes. If we aren't talking about zillions of objects here, this should be fast enough...
If not, you may have a look at Object3D.translateMesh(). This does a physical translation of the object in object space, so you may setup the translation for each object, call translateMesh() for each and merge them afterwards. This way, you should get one large object with the cubes at the correct positions.

Hope this helps.
Title: Octree question
Post by: Bart on October 25, 2003, 06:03:07 pm
It is fast enough without octree (40fps). Thanks for your help.