Is this a domcumented Collision Avoidance routine?

I keep the avatar in my app above the terrain by checking the x and z location every frame and then positioning it at the appropriate y point (i.e. the height of the terrain at point y) - I’ve seen methods of collision avoidance implemented before using picking, it seemed fairly complex. I want mine as simple as possible so I plan to do it like this:

  • Add the objects to the terrain so the avatar would go over them regardless of their height
  • At every frame, store the current x,y and z co ordinates
  • Then calculate the hieght of what the new x, y and z coordinates will be
  • If the the new y coordinate has too greater difference between that and the old one (relative to the differences betweeen the x and y as this will reflect the speed) then keep the avatar in the position of the old x, y and z.

The value that represents the difference between the old y and new y cordinates would in effect be how steep the avatar can climb.

Is this a documented mothod of collision avoidance?
How good is this, speed wise, compared to other methods - I favour speed over accuracy.

Thanks.

I question how you are determining the hieght. Are you keeping a Vector of objects that contain ground information (basically you are keeping your own bounds/geometry information)?

I’m not sure about “how good it is” b/c there are too many details not specified.

The deal w/ picking is such that you can detect say an object below you first based on the bounding box and then with the geometry (more accurate). If you do it this way, then j3d keeps track of all that stuff.

I hope this helps

"Are you keeping a Vector of objects that contain ground information (basically you are keeping your own bounds/geometry information)? "

Kind of, yeah. Is this a bad way of doing it?

“The deal w/ picking is such that you can detect say an object below you first based on the bounding box and then with the geometry (more accurate). If you do it this way, then j3d keeps track of all that stuff.”

Is there a simple example of something like this online?

“I hope this helps”

Yep 8)

[quote] Is there a simple example of something like this online?
[/quote]
Well, I don’t about simple, but there is an example. Check it out below.

http://www.j3d.org/tutorials/collision/index.html

Thanks

I’ve taken a look at this before. It says there is accopanying code to this in the Code Repository but the link is dead. Has anyone had any success implementing this?

Link works fine for me ???

We’re using the basic techniques described there, and the code as part of Xj3D, as well as a couple of other basic Java3D projects.

Hi,

I’ve now got the j3d code and it says on the site "If you want to be lazy and use some already built code, this describes the implementation of the navigation code in the j3d.org Code Repository. In particular, look at the classes org.j3d.geom.IntersectionUtils and org.j3d.ui.navigation.NavigationHandler. "

I’ve located the above two classes which look great; is there an example program that actually uses these classes?

Thanks 8)