Game Development Community

I need some VectorScale help please?

by Shon Gale · in Torque Game Engine · 10/27/2007 (6:13 am) · 2 replies

My request is simple. I need to know what the scale parameter in VectorScale means in the
(VectorScale(vec, scale)) function. I looked it up and was informed that scale - A numeric value (integer or floating-point) representing the scaling factor. but I need to know how the range or scale is measured. Is it in pixels, meters or what? I am doing Ray-Casting and have decided that this command will allow me to set the range of my cast.
Can anyone clarify please?

#1
10/27/2007 (7:14 am)
A vector is three components; x, y and z.

When you scale a vector you multiply each component by the scale factor.

When you scale a vector by say 3 you basically do:
x = x * 3
y = y * 3
z = z * 3

The unit of measurement is based on your model. Not the scale factor. The scale factor is simply a numerical multiplier. If your model is 6 feet tall and you scale by 3 it will be 18 feet tall. If your model is 6 meters tall and you scale by 3 it will be 18 meters tall.
#2
10/27/2007 (11:10 am)
I really appreciate your help and it answered my question which is: It is measured in meters. Itried it on my character in my game and wound up with a giant among men.
Once again thanks