What i basically need is a set of tools to check camera position against game map object without any physics.
So the question is, with a current state of away3d 4 is it possible make collision detection using library classes? If not - which part is missing? Otherwise where do I start, cause i have not been able to find any examples on the subject. I know there is Octree class, but i have no clue how to use it.
Collision detectionSoftware: Away3D 4.x |
||
Fossor, Newbie
Posted: 08 September 2011 10:54 PM Total Posts: 21 |
||
Fossor, Newbie
Posted: 15 September 2011 02:36 PM Total Posts: 21 [ # 1 ] Nobody? I really need my brand new game to hit the stores before Diablo 3, not a big deal you say, but I have not even started! Ok, more specific question(s): |
||
Alex Bogartz, Sr. Member
Posted: 15 September 2011 03:17 PM Total Posts: 216 [ # 2 ] So one strategy is to make a top down shot of your map and color it black and white in Photoshop. Then take the x and z properties of your camera and apply it to the map as x and y. Test the pixel color. If it’s black, you’ve hit a wall. |
||
|
||
Alejandro Santander, Administrator
Posted: 15 September 2011 04:22 PM Total Posts: 414 [ # 4 ] I am not sure if you can use native Away3D 4.x classes to detect collisions. Maybe there is, but I am not yet aware of them. Perhaps other team members are? You could very easily detect collisions using aabb’s, that is, axis aligned bounding boxes. If you need a bit more precision, you could use the more complicated, but not too complicated obb, oriented bounding box, collision detection technique. I discuss these in one of my blog posts: http://www.lidev.com.ar/obb-collision-detection/ Away3D 4.x does provide good bounding box info, including way to visualize these. hth |
||
Fossor, Newbie
Posted: 15 September 2011 06:15 PM Total Posts: 21 [ # 5 ] Thank you, Alejandro. Very nice example. But, the actual collision test, i guess, will be step 2 for me. The first step i need is - to detect only those polygons in the scene, that may collide with the moving object/camera in current period of time. From what I understand for this purpose Partition3d and Octree classes could be used to navigate and “cut” the portion of the scene around camera/object. I just don’t know how to this navigation. |
||
Alejandro Santander, Administrator
Posted: 15 September 2011 09:01 PM Total Posts: 414 [ # 6 ] You don’t have to test agains each polygon, you do against each object. For example you could test the position of the camera against the bounding box of a sphere =) I can’t say no to you asking about Partition3D and Octree, I do not know about them. |
||
|