# Rotation and vectors

Hello everyone!

I’m a newbie to vvvv, so my 2 questions could seem very easy. I think my problem lies in some global vvvv concept misunderstaing comparing to other modular graphics software (i use grasshopper a lot)

1. Let’s say I have a straight line going along X-axis starting from origin, so it has start point A coordinates {0, 0, 0} and end point B coordinates {1 or inf, 0, 0}. And I have a point C somehwere in the 3d-space width given coordinates {x, y, z}. I need to rotate my A-B line to make point C lie on A-B line (in other words, simply forward my line to point). I don’t need to construct it graphically, but I need to get a proper transformations (as I’m going to use it for other objects) How can I make that?

2. Could you please briefly describe me a vector concept in vvvv? I mean, for example, when I’m using Vector (3d join) node it requires only XYZ coordinates and I don’t quite get how vvvv interprets this data. Is it a point coordinate or a usual vector starting at {0, 0, 0} and going to defined {x, y, z}?

Thank you!

point’s to vector is what cha looking for, vector3 in general just a point coordinate

Thank you for your answer! But I still don’t get it :) I’ve made a simple patch to demonstrate process (line should start at white sphere (and it does) and go through red sphere). I think there’s some dumb mistake but I don’t see it :(

point2vector.v4p (16.9 kB)

hi. it’s really not obvious what cha trying to achieve there
i’d suggest u check that page first:
3d vector mathematics
and then post if u have more questions…
and if u just want line from one point to another u might look at LookAt transform

the line module does the trick. see patch

point2vector.v4p (10.9 kB)

I, too, don’t quite get what you want to do. Is the problem the bit where you…

need to get a proper transformations (as I’m going to use it for other objects)

and you fear gregsn’s suggestion (posted while I was typing;) will not help you? Maybe just start working on the other objects. Your problem just might disappear :)

Thank you for a suggestion Antokhio, this article is really helpfull in uderstanding vectors (I saw it before but didn’t fell that I need toread it). I guess it can be done using formula in Dot Product section (I haven’t tried it yet).

But I guess I’ve found a solution - simply use ToLine node which does a trick (I’ve attached patch with quick animation to show what I needed). I can’t say it’s very clean as I had to make some manual transformation along X axis, but for now it also fine.

The reason I needed not just to make a line like Gregsn suggested is that I needed to get a transformations only - I’m working with Intersect node right now and it requires a transformation for the ray. And I have a spread of coordinates on both sides constantly moving around 3d-space, so I needed to calculate the position and rotation amount for each ray.

point2vector.v4p (21.6 kB)