Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Collision Detection - Need help  (Read 4935 times)
0 Members and 1 Guest are viewing this topic.
Offline Miguel

Junior Newbie

Java games rock!

« Posted 2003-12-05 10:09:13 »

Hi Java Coders,

can anybody give me a helping hand regarding Collision Detection?
In comparasion to the java3d Api there seem to be a few  (WakeUpOn..) Classes left to handle easy collision detection. BoundingBox and BoundingSphere are already implemented, so collision detection couldn't be as awkward as it is in Jogl. But I don't get it.
So it would be nice, if somebody can show me a code fragment or a tut, where I can study it. Or the best case ever, show me an equivalent to the java3d TickTockCollision Demo.

thx in advance

Offline kevglass

« JGO Spiffy Duke »

Medals: 319
Projects: 25
Exp: 22 years

Coder, Trainee Pixel Artist, Game Reviewer

« Reply #1 - Posted 2003-12-05 10:17:58 »

You need to add "Haven't got a frickin clue!" Smiley


Offline William Denniss

JGO Coder

Projects: 2

Fire at will

« Reply #2 - Posted 2003-12-05 10:41:12 »

As you have no doubt seen, full Java3D Behaviour support is lacking in Xith3D currently.

Collision detection using a bounding box?  I'll describe one possible method which can be used with two 2D rectangles in pseudo code.

boolean isIntersect(Cube1, Cube2)

// Check four corners of Cube 1
Loop though all 4 corner points of Cube1.
   If point is in Cube2 (simple greater-than/less-than test on the top right and bottom left corners of the cube), then return true (they are intersecting

// Check four corners of Cube 2
Loop though all 4 corner points of Cube2.
   If point is in Cube1, then return true (they are intersecting

// No intersection
return false

Now just apply that to the 3D coordinate space and you're on your way Smiley



Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Yuri Vl. Gushchin

Senior Devvie

Speak Java!

« Reply #3 - Posted 2003-12-05 10:52:09 »

In favor of integration of ODE Physics Engine with Xith3D, I was thinking about using OPCODE (collizion detection system) included in this library for some collision detection operations.

I an waiting for approval of odejava project at to start looking for that in more details.


Yuri Vl. Gushchin
JProof Group
Offline Miguel

Junior Newbie

Java games rock!

« Reply #4 - Posted 2003-12-10 14:20:15 »

Hi All,

thx for your quick replies.
As Kev pointed out right, I  have no frickin clue. That's why I study it  Wink and code samples are very very useful. If somebody knows some post it here! In order to find some I searched the web for examples and luckily found some. A good one can be found there: and if the jogl port is not working here are the whole port's for all nehe tuts:  It's not a simple one but a very good one.
Btw I changed back to jogl because the lack of behaviour in xith3d. So I am looking forward to see it or something similar implemented  Grin
The other time I tried a little bit around, which you can see it here:
It's not good and finished, but a first try in order to get collision detection with bsp trees Wink

Happy coding

Offline DavidYazel

Junior Devvie

Java games rock!

« Reply #5 - Posted 2003-12-10 16:13:50 »

Heh, sorry but I have to chuckle a bit.  You don't have wakeup on collision, so you are going to go down tot he opengl layer and code ray to triangle bsp collision detection?  Thats like saying my car doesn't have anti-lock breaks so I am going to design and build my own car.

Well, the NeHe collision detection really can't be compared to scene level CD.  Its like dropping down into assembly language.  If you are willing to do CD at that level then why not just build your BSP on your models in the Xith3D scene and run CD in Xith3D once per frame.  Then adjust your transform groups to account for collision?  That has to be easier than writing a project at the opengl layer.

Anyway, I should have a first version of an implementation of collision avoidence and detection within a week in Xith3D.

David Yazel
Xith3D Project Founder

It may look complicated, but in the end it is just a bunch of triangles
Pages: [1]
  ignore  |  Print  

EgonOlsen (47 views)
2018-06-10 19:43:48

EgonOlsen (29 views)
2018-06-10 19:43:44

EgonOlsen (49 views)
2018-06-10 19:43:20

DesertCoockie (214 views)
2018-05-13 18:23:11

nelsongames (130 views)
2018-04-24 18:15:36

nelsongames (129 views)
2018-04-24 18:14:32

ivj94 (870 views)
2018-03-24 14:47:39

ivj94 (131 views)
2018-03-24 14:46:31

ivj94 (782 views)
2018-03-24 14:43:53

Solater (146 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!