Hi, i have a basic collision system working between the mouse pointer and a 3d object. I would like to know the point in space where the 3d object and mouse ray intersect. What class/method would I use to find this information? I tried the collision traverser getCollider method but it returns a collision node that has an x,y,and z location of 0.
what you’r looking for is called “picking” 3d objects. there are many forum threads about it. there is also an example amongst panda’s sample which demonsrates this.
it boils down to doing collisions, as you may have done already. then there are collisionentries (in your collision queue). you can querry those for the position of the collision aswell as the surface-normal of the contact point.
I have some sample code here for a ray intersecting with the shoe model. The model is tagged correctly in the egg file and the collision shows up in 3d, but the collision handler doesn’t seem to pick up on the event. The direct object does not call the in or out collision event functions. I think this is where my code is broken: