.worldOrientation to a Vector?

I know its Possible to put an Objects worldPosition in a vector that works,

Object1.worldPosition = Vector(Tracker.worldPosition).lerp(Vector(Object2.worldPosition), 0.1)
transition(Object2.worldPosition)

But what about an Objects worldOrientation? I tried replacing worldPosition with worldOrientation, but for some reason Vectors don’t seem to do Rotation!

Any other way I could get an Objects Orientation to equal another Objects Orientation with a Vector?

world.orientation.col[0] = vector pointing to x axis

world.orientation.to_euler() = a orientation vector

setting a orientation =

object.worldOrientation = vector

also

object.alignAxisToVect(target.worldOrientation.col[1],1,1)
is point objects y axis to match target objects y axis in 1 frame.

Thanks! :smiley:

But how would I plug that into this code? Or would I have to make new code?

Object1.worldPosition = Vector(Tracker.worldPosition).lerp(Vector(Object2.worldPosition), 0.1)
transition(Object2.worldPosition)

Because What I’m trying to do is make the Object’s Orientation equal another Objects Orientation. Not neccesarily assign an Orientation.

If you want it to be equal another objects orientation, you can do


Object1.worldOrientaion = Object2.worldOrientation

Still with a vector though, I probably should’ve clarified that! I want an Objects Rotation to equal another Objects rotation through a Vector.

you dont need to lerp, etc you can just use align axis to vector,

object.alignAxisToVect(target,axis,time(0-1))

the time 0 = not at all

time = 1 = instant

by the way,

Rot = target.parent.worldOrientation.to_euler()
Rot.z + own[‘X’]
Rot.y + own[‘Y’]
target.worldOrientation=Rot

is the 2nd half of simple mouse

In the BGE the orientation is handled as a matrix, rather than a vector.

If it is not equal already you get it equal by assigning an equal orientation. This is what adriansnetlis described. Maybe I do not understand what problem you discovered.

Monster, it looks like he wanted to use lerp,
basically rewritting alignAxisToVect()?

http://www.blender.org/api/blender_python_api_2_75_3/mathutils.html#mathutils.Matrix.lerp