This topic is 5000 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

i can do 2d collisions with no problems, just using x/y. But when it comes to 3d collisions it gets a bit more complicated. Im not sure exactly how it works. Does the screen rotation change anything. For example, if the screen is a birds eye view, or if its more of a warcraft III view. Would those two collisions be the same? Also, if it does matter wat the camera angle is at, could i render teh screen in a birds eye view for simplicity, do my x and y collision detections(which will make it easier to do because ill have x/y collisons for other objects, then z for teh height of the terrain) and change teh angle to any angle i want to make it look the way i want it to look. this would be easier if i could put pictures in the post, so ill try and draw it here... to check colisions i draw the camera looking down...
           camera looking down
|
_________
|        |
|        | - this is just an object
|________|
________/        \______________ ground

cameras view

|--------------------   x = left right
|                       y = up down
|   |-------|           z = in out(terrain height)
|   |       |
|   |       |
|   |_______|
|
|____________________


ok so all teh collisions can be done theoretically with great ease because its just like 2d collisions with terrain hieght(stairs and stuff). then if its possible, i can just change the cameras angle at the end to make it look bettter and to use 3d worlds to the maximum potential.
           camera now looking at an angle
/
_________
|        |
|        | - this is just an object
|________|
________/        \______________ ground


now supposing this works, i can now have the camera positioned at any angle with out any trouble with the colisions. But this makes things a bit more complex in terms of moving around. How do i figure out where the mouse has clicked in the world? My moving style will be like in Warcraft 3 but with one main guy like in Diablo II. Now if i find out how to find out where i have clicked x/y then moving will not be a problem sense i am moving only in the x/y sense w/o any angle problems. I also just plan on using the box method of colision detection. long post i hope i am clear enough and i hope i didnt ask to much but i have a lot of questions in order for me to fully understand how 3d collisions detection works. thx in advanded jake

##### Share on other sites
Well,I supposed that you have no problem with 3D isometrices view and no problem with 2D collosion check

So I Think you have problems with 3D collision detection
check this 3 dimensions

example:

if(abs(box.center.x-box2.center.x))<box1.halfhight.x+box2.halfheight.x) AND (abs(box.center.y-box2.center.y))<box1.halfhight.y+box2.halfheight.y) AND (abs(box.center.z-box2.center.z))<box1.halfhight.z+box2.halfheight.z) Then
return intersection;

about idea is absolute value of the equation of the axis center of the position of box1 minus axis center of the position of box2 is less than the summation of axis halfheitht of both box

1. 1
Rutin
37
2. 2
3. 3
4. 4
5. 5

• 11
• 10
• 13
• 103
• 11
• ### Forum Statistics

• Total Topics
632976
• Total Posts
3009672
• ### Who's Online (See full list)

There are no registered users currently online

×