Notifications
Clear all

[Closed] Unit-Length Vectors???

Does anyone know what a unit-length vector is? Here’s the context:

ANIM_rotate <x> <y> <z> <r1> <r2> <v1> <v2> <dataref>

   			This defines a rotation command.  X, Y and Z define 			an axis of rotation - they should form a [b]unit-length  			vector[/b].  r1 and r2 represent the angle of counterclockwise 			rotation when the dataref is at its minimum and maximum values 			respectively, when looking down at the 'arrow' of the vector. 			(So if the vector is 0,1,0 then a positive rotation is counterclockwise 			when viewed from above.).  v1 and v2 are the minimum and maximum dataref 			values for calibration purposes.  Dataref is the string name  			of a sim dataref.

I’m going to need to script-enforce that…

14 Replies
 PEN

It is a vector that is one unit in length. eg; fromt [0,0,0] to [1,0,0] is one unit in length.

You might want to invest in a couple of DVD’s from CG academy. Bobo did one on understanding matrices, vectors and the likes.

Which is awesome.

ditto! still trying to get my head round it all though!

Ok…I understand how to calculate a vector and how to generate a normalized vector from two points.

What if I have a single point helper…and I want to calculate the normalized (unit-length?) vector of the positive z axis…(or any specific axis)…If the point helper is at 0,0,0 and not rotated and I want the normalized vector of the positive z axis…I know it would be 0,0,1. But, if I rotate it a bit and want to calculate the unit length vector of the positive z axis…would I have to already have a vector on the z axis to calculate from or is there a quick and easy command that can pull a vector from an axis?

.transform.row3, I think.

Thats brilliant!!! Thanks!

With this I can have them use one point helper for multiple rotation axis…they just select which axis to rotate around…

i’m thinking you could also use the direction property to get the z axis and calculate a vector from it. is that correct?

v1 = $.pos – $.dir
vect = normalize v1

1 Reply
(@lehthanis)
Joined: 11 months ago

Posts: 0

It appears the .dir property is already a normalized row3…

if I place a point helper so that its in its normal state in world space (no world transform rotation) and I do a .dir on it I get 0,0,1

if I rotate it a bit along the x axis I get the same for
selection[1].dir
selection[1].transform.row3

its already normalized I think.

Of course…if I want them to specify which axis to rotate around I’ll still have to do a row1, 2 or 3 call I think.

Hi Robbie,

i was thinking about this on my train ride home and realized my logic had developed a skewed transform matrix. The dir property is a 3d vector, and yes, you are correct, it is normalized.

Page 1 / 2