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 Detector in Billiard  (Read 1905 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 Devvie

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 Devvie

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, 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 Devvie

« 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  

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

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

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

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

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

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

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

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

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

Solater (140 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!