American Football/Rugby Ball

S

Sam Davies

Hey Brian,

Thnaks for the reply, i probably was'nt that clear when i explained
what i am trying to do. To create a ball this shape in vrml takes just
a few minutes and it can be viewed in a 3 dimensional world. VRML does
all the hard mathamtics fore you, you just need to supply a few
co-ordinates. Adding the physics side of the project becomes a little
more complicated and uses java script.

VRML is basically a markup language and uses java script as its
engine. I was just wondering if anyone had ever tried creating
developing the maths needed to calculate what would happen to a rugby
ball if dropped on a flat surface. Whereas a ball would either bounce
straight back, or off at the same angle it came in at. A rugby ball
would depend on which surface was hit.

Thnaks for the reply, but from the replies i've had on some other
threads i think this problem is going to prove to be quite hard to
solve..

Cheers
Sam
 
B

Brian Genisio

Sam said:
Hey Brian,

Thnaks for the reply, i probably was'nt that clear when i explained
what i am trying to do. To create a ball this shape in vrml takes just
a few minutes and it can be viewed in a 3 dimensional world. VRML does
all the hard mathamtics fore you, you just need to supply a few
co-ordinates. Adding the physics side of the project becomes a little
more complicated and uses java script.

VRML is basically a markup language and uses java script as its
engine. I was just wondering if anyone had ever tried creating
developing the maths needed to calculate what would happen to a rugby
ball if dropped on a flat surface. Whereas a ball would either bounce
straight back, or off at the same angle it came in at. A rugby ball
would depend on which surface was hit.

Thnaks for the reply, but from the replies i've had on some other
threads i think this problem is going to prove to be quite hard to
solve..

Cheers
Sam

Yeah, the mathematics surrounding it will be brain-wracking at best :)
This is not really a Javascript question. Once you get the math down,
and translated into any programming language, it should be somewhat
trivial to get working in Javascript as well.

When it comes to math libraries, Javascript is no different from C. By
that, I mean, anything more complicated than basic trig functions needs
to be derrived from algorithms. These algorithms will likely port into
Javascript without any problem.

I guess what I am saying is this: You need to get your math and physics
understood. This is obviously out of the realm of Javascript. Once you
have figured out the mathy and physics, you need to translate that into
a programming language. Once again, this is out of the realm of
Javascript. If you choose Javascript as a language, that is fine, but
the Javascript side of things is trivial. For instance, you can make a
vector in Javascript with the following code:

function Vector( x, y, z )
{
this.x = x;
this.y = y;
this.z = z;
return this;
}

And you can create an array of vectors using the following:

var vectorArray = new Array(
new Vector( 1, 3, 4 ),
new Vector( 2, 3, 4 )
);

You access vector information like this:

vectorArray[n].x

You can create a 2x2 matrix of vectors like this:

var vectorMatrix = new Array(
new Array(new Vector(1, 2, 3), new Vector(2, 3, 4)),
new Array(new Vector(3, 4, 5), new Vector(4, 5, 6))
);


You use math libraries like this:

Math.sin( x )

Your math libraries have trig functions, such as sin, cos, tan, asin,
acos, atan. You also have things like abs, ceil, exp, floor, log, max,
min, pow, random, round and sqrt.

With these functions, you should be able to manage just about anything
with Javascript. From here on out, we are talking about algorithm
theory, and not Javascript.

I hope this helps.

Brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top