TranslateEntity rewrite?

Blitz3D Forums/Blitz3D Programming/TranslateEntity rewrite?

jondecker76(Posted 2003) [#1]
I want to rewrite my own translateentity command in native blitz code. How would I go about adding units to local entity coords and having it effect the world coords of the entity? Any help would be appreciated. thanks.


JoshK(Posted 2003) [#2]
See my matrix commands in the other post.


JoshK(Posted 2003) [#3]
See my matrix commands in the other post.

Oh, you just want to translate.

Get out of the advanced forum. Please.


JoshK(Posted 2003) [#4]
PositionEntity EntityX()+1,EntityY(),EntityZ()

Pussy


jondecker76(Posted 2003) [#5]
Ok, TranslateEntity is the wrong term.

Here, I will go into more detail -

I'm almost done with a fairly decent newtonian physics system. I'm using a type, and it has PosX, PosY, PosZ, RotX, etc.... fields. The Position fields are world co-ordinates. lets say I want to add 5 units forward (positive Z direction). This would change 2 or even 3 of the world co-ordinates, depending on where the model is facing.

Your example would work if I wanted to move only in 90 degree multiple directions.

I'm figureing I would need to use some of the rotations, as well as Sin/CoSin, but that is where I'm lacking the knowledge.


JoshK(Posted 2003) [#6]
Ah...okay.

You can position an entity in world or it's parent coordinates:

Position/Move/TranslateEntity x,y,z,True; Uses world coordinates


I would store velocities as world coordinate values. And use the above command to move the entities.

If you want to move an entity FORWARD, and don't know what that would be in world coordinates, use this:

TFormPoint 0,0,10,entity,0


The corresponding world coordinates will be TformedX(),Y(), and Z().


Ice9(Posted 2003) [#7]
I'm not sure what you are shooting for but
PositionMesh, RotateMesh
do completely different things than
PositionEntity, RotateEntity.


sswift(Posted 2003) [#8]
JonD:

It sounds like you want to move an entity, in the word, along it's local axes.

Ie, translate a plane along the direction it's Z axis is pointing.

To do that you use moveentity. With moveentity you specify how far you want the entity to move on it's own X Y and Z axis.

Same thing is true for rotations. TurnEntity does the equivalent thing with rotations.



Now the question is, now that I've explained that moveentity does this, do you still want to do it with your own, surely slower, function, for reasons unknown?


If so, then do this:

Function Move_Entity(Entity, LocalX#, Local_Y#, Local_Z#)

TFormVector LocalX#, LocalY#, LocalZ#, Entity, 0
TranslateEntity Entity, TFormedX#(), TFormedY#(), TFormedZ#()

End Function