TFormNormal / TFormVector not working?
BlitzMax Forums/MiniB3D Module/TFormNormal / TFormVector not working?
| ||
I'm giving this it's own thread to give it a little more attention. Can anyone point out what I'm doing wrong? All I get back for TFormedXYZ is 0. Also, What's the difference between TMesh and TEntity? Import sidesign.minib3d Graphics3D 800,600,32,2 Local camera:TCamera = CreateCamera() PositionEntity camera,0,0,-10 light:TLight = CreateLight() RotateEntity light,45,-90,0 Local cube:TEntity = CreateCube() RotateEntity cube,0,0,45 While Not KeyDown(KEY_ESCAPE) Cls TFormVector 0,1,0,cube,0 UpdateWorld RenderWorld Text 5,5,TFormedX#() Text 5,20,TFormedY#() Text 5,35,TFormedZ#() Flip 0 Wend EndGraphics End |
| ||
You have to save the values before calling Updateworld or Renderworld. It seems these function resets the values to 0. Difference between TEntity and TMesh is more or less simple: TEntity is the main type and nearly all others (TCamera,TLight and TMesh) are extended from this type. You could call every Entitycommand without problems with TMesh etc. But not the other way around. Therefore you have to explicit cast to eg: TMesh. Also Entitycommands (like RotateEntity) manipulate only the matrices. Meshcommands like RotateMesh transform the whole mesh, each Vertex,Triangle etc. so in fact you get a completely new mesh. |
| ||
AARRRRGGGGHHHH!!!!!! Thanks Klepto! EDIT: Yep! Now I start porting my code over.... yay? :) |