TFormNormal not working?

Blitz3D Forums/Blitz3D Programming/TFormNormal not working?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Sorry to be a pain but I think the docs are perfectly fine as they are. As an example see this snippet of code:
Graphics3D 800,600,0,2
cube=CreateCube()
sphere=CreateSphere()

a#=123.0
b#=456.0
c#=789.0

Repeat
Cls

If KeyDown(57) Then TurnEntity cube,1,2,3:TurnEntity sphere,-3,2,-1
TFormVector a,b,c,cube,sphere
Text 0,0,"TForm Vector - TFormedX:"+TFormedX()+" TFormedY:"+TFormedY()+" TFormedZ:"+TFormedZ()

VecLength#=Sqr(TFormedX()*TFormedX()+TFormedY()*TFormedY()+TFormedZ()*TFormedZ())
If VecLength>0 Then 
Text 0,20,"TForm Vector Normalised - TFormedX:"+TFormedX()/VecLength+" TFormedY:"+TFormedY()/VecLength+" TFormedZ:"+TFormedZ()/VecLength
EndIf 

TFormNormal a,b,c,cube,sphere
Text 0,40,"TFormNormal - TFormedX:"+TFormedX()+" TFormedY:"+TFormedY()+" TFormedZ:"+TFormedZ()
Text 0,60,"TFormNormal Vector Length:"+Sqr(TFormedX()*TFormedX()+TFormedY()*TFormedY()+TFormedZ()*TFormedZ())



Flip


Until KeyDown(1)
End



Note there is no renderworld or updateworld as we're not viewing anything here.

Change a,b,c which are the components of the vector in cube space to any values you like (other than all zeroes). The first tformvector command transforms this vector into 'sphere' space ie the other entity (could be any entity - a pivot even I just chose a sphere and a cube) without scaling the resulting vector.

If you compare the tformnormal results with the values of the tformvector command after normalising the tformvector output you get identical results (ie tformvector transforms a vector from one coordinate system to another without scaling the resultant vector components in tformedx(),tformedy(),tformedz() whereas tformnormal transforms a vector from one coordinate system to another and then scales it to be a unit vector (of length 1)).

Pressing space rotates the two entities.

EDIT - the reason your code in the first post causes it to go to different positions is because you have scaled the cones. If you remove the scaling from the cones then it works as it should. There must be something wrong with TFormNormal when an entity is scaled?perhaps?

EDIT 2 - Ignore me I think you've covered this all above Sorry about that. My mistake