Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (117)
games submitted by our members
Games in WIP (564)
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 Detector in Billiard  (Read 1129 times)
0 Members and 1 Guest are viewing this topic.
Offline krabbit

Innocent Bystander





« Posted 2006-05-25 12:45:06 »

Hi guys,
     this is my first post here. it's about quite months that i'm using java3d for a university project. We must realize a billiard game, 3d with java3d.
I lost my mind for days and days!!!! Cry Cry Cry
Now i'm trying to understand howto get collision between balls working. i found some behaviour like CollisionDetector that have a processStimulus method, but i need to understand howto  get a relative position of balls, howto get the exact point of impact between two balls for later calculating new direction, etc....
Could u help me to find right way to develop my subject ? i tried to search some examples but  i don't find nothing to helpful and not so complex.
I have another problem: we don't have alot of time, about one month. Could u help me? thanx   Kr4b
Offline Breakfast

Senior Member




for great justice!


« Reply #1 - Posted 2006-05-25 13:58:29 »

If I were working on your project, I would approach it thus: I would separate the physics model from the 3D view entirely. If you think about it, everything in a game like billiards is working in 2D so it would be smart to create a 2D model of your table and balls and use that to calculate your collisions, trajectories and movement. I would tie it in to a simple 2D visual representation for testing.

I would then use that model to place my balls in my Java3D environment, so I would run a behaviour that ran every frame and just requested the current positions of the balls from the internal representation of the game and used that to set the x and z co-ordinates of the balls in the scene.

J3D doesn't have very good collision detection so this would be quicker and more accurate for this kind of project.
Offline Mr. Gol

Senior Member


Medals: 1



« Reply #2 - Posted 2006-05-25 14:00:59 »

The standard collision detection that Java3D offers isn't what you want. Instead of collision detection you need collision avoidance, J3D.org has some good articles about that. Since it's a billiard game you may not even need that, since you can calculate everything if you have the positions and the radius of the balls. Circle/circle collision physics are quite hard, but I'm sure you can find some examples on the internet.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline otelo

Junior Member





« Reply #3 - Posted 2006-05-25 20:19:27 »

Circle/circle collision physics are quite hard...
Circle - circle collisions are hard? They are almost trivial compared to everything else! Breakfast's idea is very good in that respect,
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.

Grunnt (21 views)
2014-09-23 14:38:19

radar3301 (14 views)
2014-09-21 23:33:17

BurntPizza (31 views)
2014-09-21 02:42:18

BurntPizza (22 views)
2014-09-21 01:30:30

moogie (20 views)
2014-09-21 00:26:15

UprightPath (29 views)
2014-09-20 20:14:06

BurntPizza (33 views)
2014-09-19 03:14:18

Dwinin (48 views)
2014-09-12 09:08:26

Norakomi (75 views)
2014-09-10 13:57:51

TehJavaDev (108 views)
2014-09-10 06:39:09
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!