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 (563)
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  
  3d maths fundamentals for high level APIs  (Read 2432 times)
0 Members and 1 Guest are viewing this topic.
Offline DrQuincy

Junior Member




Vwls hv bn bnnd!


« Posted 2003-11-06 05:56:40 »

hello

I'm getting back into Java3d for a uni project which requires me to work out how balls traject from a cannon.  It's made me realise how bad my maths are.  Could anyone please point me towards a nice article/tutorial that will help me grasp the Maths I will need for a high-level API like Java3D?

Thanks Cheesy
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #1 - Posted 2003-11-06 08:37:52 »

Cannon ball trajectories are basically just the effect of acceleration and velocity over time. All you really need are the basics: F = ma and v = u + at

You'll need the mass of the ball, and your acceleration due to gravity (typically -9.81m/s2). Your ball also starts with an initial velocity from the lanuch.

Then every frame you calculate the acceleration on the ball from gravity, and modify your speed accordingly. Then you use the speed to find the distance traveled this frame. This will then give you a nice parabolic arc Smiley

Its not 100% accurate, but about the only thing missing is the effect of wind resistance. You could probably use some sort of constant drag (or speed-dependant drag) and subtract that from your velocity every frame.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline Breakfast

Senior Member




for great justice!


« Reply #2 - Posted 2003-11-06 10:58:37 »

Generally you will want to bone up on trigonometry and vector maths. There is quite a lot of stuff on this around and it isn't too hard.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline DrQuincy

Junior Member




Vwls hv bn bnnd!


« Reply #3 - Posted 2003-11-06 12:34:15 »

Hi Breakfast,

One of the first things I did in getting back into Java3D was to read through your tutorial.  I need to make the camera follow the ball so I think your work will be of use to me Smiley
Offline Breakfast

Senior Member




for great justice!


« Reply #4 - Posted 2003-11-06 13:20:31 »

It's a starting point anyways- I wanted to adapt the camera behaviour to make it  a better "followcam" kind of thing, but I haven't really got around to it and I doubt I will now, as my current obsession is trees.

I'm really glad people are using the tutorial.
Offline Preston

Senior Member


Medals: 4



« Reply #5 - Posted 2003-11-06 13:38:00 »

Quote
Hi Breakfast,
One of the first things I did in getting back into Java3D was to read through your tutorial.  I need to make the camera follow the ball so I think your work will be of use to me :)

Sounds interesting: where is this tutorial, please?

I'm trying to learn Xith3d and since its scenegraph architecture is very similar to Java3d...

So far I just know SUN's official Java3d tutorial, which is quite good I think (http://developer.java.sun.com/developer/onlineTraining/java3d/)
Offline Breakfast

Senior Member




for great justice!


« Reply #6 - Posted 2003-11-06 14:19:26 »

Tutorial here - it is pretty much the kind of stuff that I wished I had been able to find when I started with J3D. I have been too busy lately to actually play with Xith3D  so I don't know how well they interoperate in terms of behaviours, loaders and so on, all of which which  my tutorial uses quite heavily.
Offline Preston

Senior Member


Medals: 4



« Reply #7 - Posted 2003-11-06 16:22:01 »

Quote
(..)I have been too busy lately to actually play with Xith3D  so I don't know how well they interoperate in terms of behaviours, loaders and so on, all of which which  my tutorial uses quite heavily.

Thanks for the URL.
When I'm going to read your tutorium I'll see how it fits to Xith3d and vice versa. I'll try to make a few remarks here.

Thanks again, cheers!
Offline DrQuincy

Junior Member




Vwls hv bn bnnd!


« Reply #8 - Posted 2003-11-06 18:46:36 »

The piece I am working on is actually a final year project so from now until June I will be binging Java3d - the use of cameras will play a big part in my game so hopefully I'll be able to cover some ground on top of that.

I'm doing java3d over xith because of the support currently out there for java3d (with it being project work I need references, etc) but come June when I finish uni I see xith as the logical next step

anyways, I think you'll be seeing a lot of question from me in the next 6 months :S

Quote
It's a starting point anyways- I wanted to adapt the camera behaviour to make it  a better "followcam" kind of thing, but I haven't really got around to it and I doubt I will now, as my current obsession is trees.

I'm really glad people are using the tutorial.

Offline drg

Junior Newbie




Java games rock!


« Reply #9 - Posted 2003-11-07 07:39:55 »

Calculation of the drag force is fairly straight forward for simple shapes such as spheres or teardrops in air.

Drag = 0.5 * density * cross-sectional-area *velocity ^2 *Cd

where Cd - drag coefficient, remembering to use consistent UNITS of course!!!

the drag coefficient for simple shapes can be found on the web for a sphere this is roughly 0.5, however, if you wish to perform more accurate aerodynamic predicitions than this does vary with a dimensionless number called the Reynolds number. The Reynolds number is a function of the density, vsicosity, velocity and a characteristic dimension of the object i.e. the diameter of the sphere.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline NeoRetro

Junior Newbie




Java games rock!


« Reply #10 - Posted 2003-11-19 06:31:58 »

Need a refresher course and a nice math worksheet?  Pick up a copy of Mathsoft's Studyworks.  Great program with lots of uses.  Not too expensive either.
Offline EgonOlsen
« Reply #11 - Posted 2003-11-19 13:45:53 »

http://www.flipcode.com/geometry/

Offline DrQuincy

Junior Member




Vwls hv bn bnnd!


« Reply #12 - Posted 2003-11-19 13:49:00 »

Quote


hey, thats a good one Cheesy
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.

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

BurntPizza (30 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 (28 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 (74 views)
2014-09-10 13:57:51

TehJavaDev (103 views)
2014-09-10 06:39:09

Tekkerue (50 views)
2014-09-09 02:24:56
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!