Author Topic: Octree question  (Read 4998 times)

Offline Bart

  • byte
  • *
  • Posts: 11
    • View Profile
    • http://home.deds.nl/~svg
Octree question
« 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: )
o java or not to java

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Octree question
« Reply #1 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.

Offline Bart

  • byte
  • *
  • Posts: 11
    • View Profile
    • http://home.deds.nl/~svg
Octree question
« Reply #2 on: October 25, 2003, 06:03:07 pm »
It is fast enough without octree (40fps). Thanks for your help.
o java or not to java