jPCT - a 3d engine for Java > Support

Octree question

(1/1)

Bart:
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: )

EgonOlsen:
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.

Bart:
It is fast enough without octree (40fps). Thanks for your help.

Navigation

[0] Message Index

Go to full version