Java-Gaming.org Hi !
 Featured games (88) games approved by the League of Dukes Games in Showcase (681) Games in Android Showcase (196) games submitted by our members Games in WIP (744) games currently in development
 News: Read the Java Gaming Resources, or peek at the official Java tutorials
Pages: [1]
 ignore  |  Print
 3d maths fundamentals for high level APIs  (Read 3365 times) 0 Members and 1 Guest are viewing this topic.
DrQuincy

Junior Devvie

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
Orangy Tang

JGO Kernel

Medals: 57
Projects: 11

 « 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

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 ]
Breakfast

Senior Devvie

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.
DrQuincy

Junior Devvie

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
Breakfast

Senior Devvie

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.
Preston

Senior Devvie

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/)
Breakfast

Senior Devvie

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.
Preston

Senior Devvie

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!
DrQuincy

Junior Devvie

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.

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.
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.
EgonOlsen
 « Reply #11 - Posted 2003-11-19 13:45:53 »

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

DrQuincy

Junior Devvie

Vwls hv bn bnnd!

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

Quote

hey, thats a good one
Pages: [1]
 ignore  |  Print

You cannot reply to this message, because it is very, very old.

 CopyableCougar4 (30 views) 2016-06-25 16:56:52 Hydroque (65 views) 2016-06-22 02:17:53 SwampChicken (67 views) 2016-06-20 13:22:57 SwampChicken (67 views) 2016-06-20 13:22:49 SwampChicken (63 views) 2016-06-20 13:22:26 Hydroque (106 views) 2016-06-15 08:22:50 Hydroque (99 views) 2016-06-13 06:40:55 DarkCart (223 views) 2016-05-29 02:30:33 Hydroque (182 views) 2016-05-26 14:45:46 Mac70 (178 views) 2016-05-24 21:16:33
 Spasi 49x theagentd 45x NegativeZero 39x KaiHH 29x LiquidNitrogen 23x princec 20x kingroka123 15x ags1 15x CoDi^R 15x ra4king 13x Opiop 10x Hydroque 9x purenickery 9x Archive 8x czak 7x DarkCart 7x
 Making a Dynamic Plugin Systemby Hydroque2016-06-25 00:13:25Java Data structures2016-06-13 21:22:09Java Data structures2016-06-13 21:20:42FPS Camera Tutorialby Hydroque2016-05-22 05:40:58Website offering 3D Models specifically for games for freeby vusman2016-05-18 17:23:09Website offering 3D Models specifically for games for freeby vusman2016-05-09 08:50:56Website offering 3D Models specifically for games for freeby vusman2016-05-06 11:10:21Website offering 3D Models specifically for games for freeby vusman2016-04-29 12:56:17
 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