Ok.
Dmitri Rubinstein wrote:
Hi. I experimented last week with the instance animation in Manta, and still have two problems. Maybe you can help.There really should be. In a previous message I referred to an example scene with a spinning texture mapped sphere... I couldn't track it down and I'm pretty sure it used those methods, it's possible it was in another branch since the methods aren't there. I'll try to get those methods back in the next day or so.
I modified a bit manta.cc example and created simple rigid body animation scene (see attachment). There are two geometry objects loaded from obj files with ObjGroup and corresponding two DynBVH acceleration structures. Then I instantiate first object (airplane) once and second (propeller) twice. All three instances are added to the world Group. In the animationCallback I animate all three by changing their transformation matrices. However here is the first problem. The only possibility to set Instance's matrix was to copy your class and add setTransform method. Is there a better way to do this ?
As long as I correctly understand DynBVH code it require only that elements of a group should have correct computeBounds method. So I assume it is applicable to any kind of a group. As VRML mostly provide rigid body animation, I always have a lot of instances on the top level. When there is no possibility to build an acceleration structure over them the rendering will be very slow.
The second problem happens when I try to create DynBVH for the complete scene. I create worldBvh and call worldBvh->rebuild(world) after the scene is constructed. Then I set scene's object to worldBvh instead of world (commented out in the source), and rebuild worldBvh in the animationCallback after instance transformation matrices are updated. However I see only a floor parallelogram. What am I doing wrong ?
You might be the first person to try using instancing with DynBVH... I'll ask around....
Abe
Greetings
Dmitri
P.S. In order to compile manta_test you need scons (http:://www.scons.org) and MANTA_PATH environment var should point to Manta directory. Or simply compile executable from manta_test.cxx and MyInstance.cxx .
Archive powered by MHonArc 2.6.16.