Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (404)
games submitted by our members
Games in WIP (289)
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 1307 times)
0 Members and 1 Guest are viewing this topic.
Offline Miguel

Junior Newbie




Java games rock!


« Posted 2003-12-05 11: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

Miguel
Offline kevglass
« League of Dukes »

JGO Kernel


Medals: 54
Projects: 20


Mentally unstable, best avoided.


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

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

Kev

Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #2 - Posted 2003-12-05 11: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.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
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

Cheers,

Will.

Games published by our own members! Check 'em out!
Try the Free Demo of Droid Assault
Offline Yuri Vl. Gushchin

Senior Member




Speak Java!


« Reply #3 - Posted 2003-12-05 11: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 java.net to start looking for that in more details.

Yuri

Yuri Vl. Gushchin
JProof Group
Offline Miguel

Junior Newbie




Java games rock!


« Reply #4 - Posted 2003-12-10 15: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: http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=30 and if the jogl port is not working here are the whole port's for all nehe tuts: http://pepijn.fab4.be/nehe/  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: http://mitglied.lycos.de/redries/jogl/Kollision.java
It's not good and finished, but a first try in order to get collision detection with bsp trees Wink

Happy coding

Miguel
Offline DavidYazel

Junior Member




Java games rock!


« Reply #5 - Posted 2003-12-10 17: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
http://xith3d.dev.java.net

It may look complicated, but in the end it is just a bunch of triangles
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Get high quality music tracks for your game!

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (49 views)
2013-05-17 21:29:12

alaslipknot (58 views)
2013-05-16 21:24:48

gouessej (88 views)
2013-05-16 00:53:38

gouessej (86 views)
2013-05-16 00:17:58

theagentd (95 views)
2013-05-15 15:01:13

theagentd (88 views)
2013-05-15 15:00:54

StreetDoggy (133 views)
2013-05-14 15:56:26

kutucuk (154 views)
2013-05-12 17:10:36

kutucuk (154 views)
2013-05-12 15:36:09

UnluckyDevil (164 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
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!
Page created in 0.103 seconds with 21 queries.