We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
VectorD Library (Read 2395 times)
VectorD Library
Jun 10th, 2005, 10:51am
 
Hi,

just coded a 2D and 3D Vector library.

http://wilma.vub.ac.be/~aarrassi

Don't forget it's an super-alpha-version-coded-between-two-exams-library. So don't forget this when you'll used it for your-high-tech-research-program-on-planetary-motion.

Examples are also available.

My inspiration was the Robert Penner Flash MX vector library to describe motions. But a merged it with some function found in the book "Beginning Math and Physics for Game Programmers" from Wendy Stahler.

That's it have fun.



ARRASSI Zakaria
Belgium
Re: VectorD Library
Reply #1 - Jun 10th, 2005, 7:05pm
 
Very nice and clean. This is interesting.

Have a look at my own implementation for comparison. I focused a lot of mine around being able to transport vector data into angular and distance data, as well as being able to create new vectors from another vector's angular and distance displacement.

http://users.design.ucla.edu/~mflux/p5/xenoforms/veclib.pde

I also wrote a physics library on top of that:
http://users.design.ucla.edu/~mflux/p5/xenoforms/physics.pde

btw you should export your applets with P3D, as the processing renderer right now is extremely slow...

keep it up! XD
Re: VectorD Library
Reply #2 - Jun 10th, 2005, 7:27pm
 
Your library has some interesting points.

For example I don't support rotations...yet.

I'm right in the middles of my exams, so I have to focus on something else.
But if you agree next month i'll be free like a bird and perhaps we could merge your library with mine and take the best of both.


Tell me what  you think of this.
Re: VectorD Library
Reply #3 - Jun 11th, 2005, 3:37am
 
I've been using David Heubners (myT's) FVector class widely in a new 3D camera interface - I think its very good, certainly has all the features I need:

Coincidently he released it like yesterday (not to beat you to the bullet or anything Smiley)
Processing discussion:
http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Contribution_3DOpenGL;action=display;num=1117948963
FVector class:
http://www.millbridge.de/processing/FVector.pde
Re: VectorD Library
Reply #4 - Jun 11th, 2005, 11:07am
 
Indeed,

but his library is focused on vector with N dimension.
Altought I don't think going to more than 3 dimension is interestring for computer graphics.

I don't think his library and my are concurrent but either complementary.
For example he does'nt has some simple function that are useful when
drawing in processing; normalize, negate , reset.

The fact that he is concentrating on vector with N dimension make it
in theory a little bit slower cause he has to use 'for-iteration' to acces
first,the second and the third element.

In conclusion the library differ in many point.
But hey, aren't we all here for one thing.

Making processing better.

What I target with my library in the futur is to extend it
to a physics library and to add motion equation to the vectors and perhaps
to have one game engine class with all the stuff necessary for games.

That's it. Thanks to indicate me that some people already made some stuff.
It can only make processing better.


Re: VectorD Library
Reply #5 - Jun 13th, 2005, 1:10am
 
Hi Zakaria here's my response to your email:

In response to your rotations, I think you want this snippet of code:

Code:

   ang=radians(ang);
   x+=cos(ang)*magnitude;
   y-=sin(ang)*magnitude;  


That will give you a new X,Y pair based on a previous X,Y, plus a rotation (ang), and distance (magnitude).

Enjoy!

btw
You might want to check out max's physics library here:
http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Contribution_Simlation;action=display;num=1118602040;start=0
Re: VectorD Library
Reply #6 - Jun 13th, 2005, 9:30am
 
thx

I will test this as soon as I have some time.
Those exams are killing me Smiley

Just uploaded the source code on http://wilma.vub.ac.be/~aarrassi
Page Index Toggle Pages: 1