3d maths fundamentals for high level APIs

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 :smiley:

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 :slight_smile:

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.

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.

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 :slight_smile:

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.

[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 :slight_smile:
[/quote]
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/)

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.

quoteI 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.
[/quote]
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!

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.
[/quote]

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.

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.

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

[quote]http://www.flipcode.com/geometry/
[/quote]
hey, thats a good one :smiley: