I’m trying to make a trial game in which I use the mouse to point on a 3d object and it worked well…but as I put the mouse on a 3d object the game begin to slow down in an obvious way and it return to its normal when put the mouse away from it
why that slow down and is there a solution to this
If you need the code, I’ll write it
If you’re using picking (i.e. collisions) to detect when your mouse is pointing to 3-D objects, you do have to be careful. Using collisions in conjunction with actual geometry (as opposed to special collision geometry) is indeed very, very slow. It’s OK if you do it only once in a while, but if it’s an integral part of your gameplay, you should probably construct and use collision geometry–spheres and tubes and such–instead of colliding with visible geometry.
That’s a very bad news…unfortunately I’m using non uniformed models that will not match with the collision solid shapes (sphere,tube,…)…but maybe no slow down occurs if I use low poly models
anyway thank you
Now I find the solution and will put it for futur searchers:
1- the model itseilf in blender may be reduced using Poly Reducer script found in Scripts -> Mesh -> Poly Reducer
2- Export the model in egg exporter in egg format only
3- make the model has CollisionNode other than GeomNode
by opening the egg file in file editor (open with Notepad) and put the code for CollisionNode using this thread discourse.panda3d.org/viewtopic.php?t=6845
4- Save the model then convert it to bam file using egg2bam
5- Now when using the mouse to detect 3d model put
The poly reducer script, as the ‘decimate’ tool, are powerfull for reducing your mesh’s vertex count but, for Panda, I would suggest using the ‘retopo tool’ instead.
Indeed, it’s taking much more time with retopo but at least you know what the result is and specially you’ll continue using quad instead of triangles.
Also, using retopo allow you to keep your high poly model which you’ll might need later for normal mapping or other stuff…