## Algorithms

Moderators: None (Apply to moderate this forum)
Number of posts: 786

This Forum Only

3d Colision Detection in java format Posted by GrimChild on 28 Aug 2002 at 9:38 PM
Hi.

Im creating a very simple Java 3D engine (wireframe only, and not using the Java3D API);

I can now Do Camera Rotations And Translations around objects and everything seems to be Just Beautiful.
So Now,
How would I go about colision detection using :
X,Y, and Z (Rotation Angles, and Translation steps);

Remember,
I Am Looking For Something Completely Simple
That way I Might Be Able To Understand Whats Going On Instead Of Just Using An Algorythm.

Thank You Sincerely !
*GrimChild*
Re: 3d Colision Detection in java format Posted by Josh Code on 29 Aug 2002 at 4:02 PM
when you check for a collision, usually you are moving an object.

If you wanted to check if the centre of an object will go through a polygon:
1. create ray between the 2 points(past and future centre of object).
2. calculate the intersection point of that ray and the polygon.
3. Check to see if that intersection lays between the 2 centre points of the object. If yes, abviously a collision will happen in the move so the object shouldn't be allowed to move there.

4. You might want to do this check with several polygons that the object might be colliding with.

: Hi.
:
: Im creating a very simple Java 3D engine (wireframe only, and not using the Java3D API);
:
: I can now Do Camera Rotations And Translations around objects and everything seems to be Just Beautiful.
: So Now,
: How would I go about colision detection using :
: X,Y, and Z (Rotation Angles, and Translation steps);
:
: Remember,
: I Am Looking For Something Completely Simple
: That way I Might Be Able To Understand Whats Going On Instead Of Just Using An Algorythm.
:
: Thank You Sincerely !
: *GrimChild*
:

Re: 3d Colision Detection in java format Posted by GrimChild on 5 Sept 2002 at 9:23 PM
Polygon intersection sounds good.
I Just remembered that Java&#8482; has a built in method for polygons ( .inside() ), returns a boolean value indicating ( in 2d ) whether my point lies within the area of my polygon..
Thanks..

## Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic