Getting x value from a vector

I have a vector from

location = self get-location.

and I want to get the x value of the location. Any way to do this?

I tried

location = self get-location.
onlyX = (location * [ (1.0, 0, 0), (0, 0, 0), (0, 0, 0) ]).
xVal = |onlyX|.

but the vector onlyX ends up with nan/junk like -1.#QNAN, so xVal also comes up with a similar value.

Any ideas?
Thanks,
Jonathan

Getting x value from a vector

Not sure why you're getting the NaNs there, but the simple way to get a vector component is using this notation:

xValue = myVector::x.

I notice that this isn't in the documentation -- I'll make sure it gets added!

- jon

Getting x value from a vector

Jon,

That did the trick.

Thank you,

Jonathan

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.