Java-Gaming.org Hi !
 Featured games (84) games approved by the League of Dukes Games in Showcase (565) Games in Android Showcase (151) games submitted by our members Games in WIP (606) 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 2687 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.

 theagentd (11 views) 2015-03-27 23:08:20 wxwsk8er (52 views) 2015-03-20 15:39:46 Fairy Tailz (46 views) 2015-03-15 21:52:20 Olo (28 views) 2015-03-13 17:51:59 Olo (30 views) 2015-03-13 17:50:51 Olo (37 views) 2015-03-13 17:50:16 Olo (43 views) 2015-03-13 17:47:07 ClaasJG (56 views) 2015-03-10 11:36:42 ClaasJG (41 views) 2015-03-10 11:33:01 Pippogeek (47 views) 2015-03-05 14:36:23
 basil_ 22x BurntPizza 21x LiquidNitrogen 21x KevinWorkman 20x EgonOlsen 17x theagentd 16x Roquen 16x princec 11x Varkas 10x 65K 10x Riven 10x SHC 9x Ashedragon 8x phu004 7x wessles 7x lcass 7x
 How to: JGO Wikiby Mac702015-02-17 20:56:162D Dynamic Lighting2015-01-01 20:25:42How do I start Java Game Development?by gouessej2014-12-27 19:41:21Resources for WIP gamesby kpars2014-12-18 10:26:14Understanding relations between setOrigin, setScale and setPosition in libGdx2014-10-09 22:35:00Definite guide to supporting multiple device resolutions on Android (2014)2014-10-02 22:36:02List of Learning Resources2014-08-16 10:40:00List of Learning Resources2014-08-05 19:33:27
 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