PDA

View Full Version : vector field



Tenson
08-23-2003, 10:20 PM
I'd like to know where could I find a simple tutorial or source code example for drawing vector fileds?
And yes, I've tried searching 4 it on net http://www.opengl.org/discussion_boards/ubb/smile.gif

Thanx

1234!
08-24-2003, 11:51 AM
What do you mean when you say 'vector field'?

A number of spatial 3d coordinates that have no interconnection?

I suggest that you explain your problem in more detail because I am afraid that I am not the only one who has no clue of what you are trying to do.

Regards.

satan
08-24-2003, 04:00 PM
Originally posted by 1234!:
What do you mean when you say 'vector field'?


I think he means this: http://mathworld.wolfram.com/VectorField.html

But I am afraid that I do not understand the problem of drawing one?

Tenson
08-25-2003, 07:20 AM
Well an example then...

If you have 2 charged spheres and you wish to draw Coloumb's electostatic field ( E - field ) you would use small arrows to draw it. The length of arrows would represent field strength and their orientation would tell where is drain and where is the source of field.
I know you can calculate vector from 2 points points like this:
vectorAB = B - A // b begining point, a end point

The problem is how to calculate as many vectors as you need to see the shape of field in 3D if vector function is known.

satan
08-25-2003, 02:27 PM
for x:=-20 to 20 do
for y:=-20 to 20 do
for z:=-20 to 20 do
Vec:=VecFunc(x,y,z);
draw(x+Vec.x, y+Vec.y, z+Vec.z);

I hope you get what I mean. But perhaps I misunderstood your question.
(edit: typo)

[This message has been edited by satan (edited 08-25-2003).]

gumby
08-25-2003, 05:35 PM
LIC is a popular texture-based technique for visualizing vector fields. Search for "Line Integral Convolution."