Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (476)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (533)
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 1704 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

JGO Kernel


Medals: 120
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« 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!
Legends of Yore - The Casual Retro Roguelike
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.

 

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

The first screenshot will be displayed as a thumbnail.

pw (21 views)
2014-07-24 01:59:36

Riven (19 views)
2014-07-23 21:16:32

Riven (16 views)
2014-07-23 21:07:15

Riven (19 views)
2014-07-23 20:56:16

ctomni231 (47 views)
2014-07-18 06:55:21

Zero Volt (43 views)
2014-07-17 23:47:54

danieldean (34 views)
2014-07-17 23:41:23

MustardPeter (38 views)
2014-07-16 23:30:00

Cero (53 views)
2014-07-16 00:42:17

Riven (52 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org 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‑gaming.org
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!