AlignToVector Question

Blitz3D Forums/Blitz3D Beginners Area/AlignToVector Question

jfk EO-11110(Posted 2006) [#1]
Thought I know how to use it, but how can I use AlignToVector without pickedNX() or CollisionNX() ?

Say I have a mesh and I want an other mesh to align to it smoothly, but there was no Linepick or Collision. All I got is EntityPitch/Yaw/Roll. How should I do that?


H&K(Posted 2006) [#2]
You pick a Vector, and align them both to it


Stevie G(Posted 2006) [#3]
I think you can do it like so ...

tformnormal 1,0,0,Target, 0
aligntovector Source, tformedx(), tformedy(), tformedz(), 1, Rate#

tformnormal 0,1,0,Target, 0
aligntovector Source, tformedx(), tformedy(), tformedz(), 2, Rate#

tformnormal 0,0,1,Target, 0
aligntovector Source, tformedx(), tformedy(), tformedz(), 3, Rate#


Not sure if that works as haven't tested but you may get away with aligning on the x and z axis only.

Stevie


Bobysait(Posted 2006) [#4]
you coud also use deltaPitch deltayaw and delateroll functions.

if you can use EntityX entityY and EntityZ, maybe this should work:



jfk EO-11110(Posted 2006) [#5]
Bobysalt - I tried that, isn't that easy compared to position things. Pitch goes from 0 to 90 then to -90 and finally back to zero. Yaw seems to jump from 180 to -180 depending on roll - or the other way, however, it's still confusing me. If there's a working delta angle function then let me know.

But that's really for what AlignToVertex would be useful.

Stevie - thanks a lot, I'll try that.


jfk EO-11110(Posted 2006) [#6]
H&K - that's what I tried, with Linepick it works, but I don't want to Linepick because it may slow things unneccessarily down.

Stevie - works perfectly! Thanks!


Bobysait(Posted 2006) [#7]
As confusion comes form Euler to Quat transforms, it 's confusing me too ...