Stevie -
Thank you for your response.
You've given me something to chew on with respect to the other permutations...I am still confused about the TFormPoint command though.
TFormVector and TFormNormal give results (at least with the examples in Blitz help docs TForming an entity to 3D space) that are intuitive to me.
On the other hand, I'm not sure what TFormPoint is telling me (with the resulting TFormedX, etc. commands). It seems to make sense when the ship is pointing up at zero roll. It seems to be telling me the ship is in the target's local coordinates - basically a vector from the target to the ship. But as soon as the ship rotates and does not move it's position, the TFormedX, etc. commands change values (specifically the X and Y versions in the code following program authored originally by you I think (Hit space to change target location and hit G to rotate a bit):
Graphics3D 1280,1024,32,1
Global Camera = CreateCamera() : PositionEntity Camera, 0, 0, -30
Global Ship = CreateCone(): ScaleMesh Ship, 1, 2, 1 : EntityColor Ship, 0,0,255 ;: PositionEntity Ship, +0.000, +0.000, +10.000
Global Target = CreateCube() : EntityColor Target,255,0,0
WireFrame True
Repeat
If KeyHit( 57 )
PositionEntity target, Rand(-20,20 ), Rand(-20,20 ), 10
EndIf
DR# = DELTAroll#( Ship, Target )
If KeyHit( 34 )
TurnEntity ship, 0, 0, DR# * 0.10
End If
RenderWorld()
Text 10,10,"Delta Raw: "+DR#
Text 10,30,"TFormedX: "+TFormedX()
Text 10,40,"TFormedY: "+TFormedY()
Text 10,50,"TFormedZ: "+TFormedZ()
Text 10,70,"Target X: "+EntityX( target )
Text 10,80,"Target Y: "+EntityY( target )
Text 10,90,"Target Z: "+EntityZ( target )
Text 10,110,"Ship X: "+EntityX( ship )
Text 10,120,"Ship Y: "+EntityY( ship )
Text 10,130,"Ship Z: "+EntityZ( ship )
Flip
Until KeyDown(1)
;=================================================================================
;=================================================================================
;=================================================================================
Function DELTAroll#( Source , Target )
TFormPoint 0,0,0 , Target, Source
Return VectorYaw ( TFormedX() , 0 , TFormedY() )
End Function
So after running the above and hitting spacebar once, the target will move and provide a vector within the TFormed commands in order to get from the target to the ship. Once G is hit to rotate the ship a bit, the TFormed commands produce different values even though neither entity actually moved locations. Perhaps the TFormed results are derived from 2 components - relative location and angle of rotation even though 0,0,0 is used in it? To me, it seems that angle of rotation would only come into play with respect to the TFormed commands if non-zeros were used in the TFormPoint command.
So I suppose, I'm just not sure what the TFormPoint does and what it is trying to tell the uninitiated through it's TFormedX,Y, and Z commands. None of the Blitz help docs for TFormPoint addressed angle of rotation.
I apologize for the long winded-ness fo the above...thanks for your help!
Thank you for your response.
You've given me something to chew on with respect to the other permutations...I am still confused about the TFormPoint command though.
TFormVector and TFormNormal give results (at least with the examples in Blitz help docs TForming an entity to 3D space) that are intuitive to me.
On the other hand, I'm not sure what TFormPoint is telling me (with the resulting TFormedX, etc. commands). It seems to make sense when the ship is pointing up at zero roll. It seems to be telling me the ship is in the target's local coordinates - basically a vector from the target to the ship. But as soon as the ship rotates and does not move it's position, the TFormedX, etc. commands change values (specifically the X and Y versions in the code following program authored originally by you I think (Hit space to change target location and hit G to rotate a bit):
Graphics3D 1280,1024,32,1
Global Camera = CreateCamera() : PositionEntity Camera, 0, 0, -30
Global Ship = CreateCone(): ScaleMesh Ship, 1, 2, 1 : EntityColor Ship, 0,0,255 ;: PositionEntity Ship, +0.000, +0.000, +10.000
Global Target = CreateCube() : EntityColor Target,255,0,0
WireFrame True
Repeat
If KeyHit( 57 )
PositionEntity target, Rand(-20,20 ), Rand(-20,20 ), 10
EndIf
DR# = DELTAroll#( Ship, Target )
If KeyHit( 34 )
TurnEntity ship, 0, 0, DR# * 0.10
End If
RenderWorld()
Text 10,10,"Delta Raw: "+DR#
Text 10,30,"TFormedX: "+TFormedX()
Text 10,40,"TFormedY: "+TFormedY()
Text 10,50,"TFormedZ: "+TFormedZ()
Text 10,70,"Target X: "+EntityX( target )
Text 10,80,"Target Y: "+EntityY( target )
Text 10,90,"Target Z: "+EntityZ( target )
Text 10,110,"Ship X: "+EntityX( ship )
Text 10,120,"Ship Y: "+EntityY( ship )
Text 10,130,"Ship Z: "+EntityZ( ship )
Flip
Until KeyDown(1)
;=================================================================================
;=================================================================================
;=================================================================================
Function DELTAroll#( Source , Target )
TFormPoint 0,0,0 , Target, Source
Return VectorYaw ( TFormedX() , 0 , TFormedY() )
End Function
So after running the above and hitting spacebar once, the target will move and provide a vector within the TFormed commands in order to get from the target to the ship. Once G is hit to rotate the ship a bit, the TFormed commands produce different values even though neither entity actually moved locations. Perhaps the TFormed results are derived from 2 components - relative location and angle of rotation even though 0,0,0 is used in it? To me, it seems that angle of rotation would only come into play with respect to the TFormed commands if non-zeros were used in the TFormPoint command.
So I suppose, I'm just not sure what the TFormPoint does and what it is trying to tell the uninitiated through it's TFormedX,Y, and Z commands. None of the Blitz help docs for TFormPoint addressed angle of rotation.
I apologize for the long winded-ness fo the above...thanks for your help!