The way entities work...

Blitz3D Forums/Blitz3D Programming/The way entities work...

Ross C(Posted 2004) [#1]
Ok, i've just been thinking about it. I take it either:

Entities are positioned using two different systems. Entity positions and mesh positions, or

Entities are only temperary positioned at the some point. Because:

When using addmesh, it uses the meshes true positions when adding them. Not there positions using PositionEntity, MoveEntity, RotateEntity and ScaleEntity. It seems to me that entities are always kept at 0,0,0 and moved to a position for rendering and collision. I don't really know where i'm going with this :D

Same thing with Vertex positioning commands. If you use PositionMesh and RotateMesh and ScaleMesh, it seems like there are absolute commands for positioning and rotating and scaling. If you used only mesh commands, getting vertex positions and such wouldn't need you translate them into global positions. I suppose this could be a drawback when moving vertices around in the entities space, and i suppose thats why entity commands are used realy. To keep moving, rotating and scaling local to the entities centre :o)

Anyway, outspoken thoughts over with :D Bye!


Rottbott(Posted 2004) [#2]
I'm not certain, but I believe using PositionMesh to move meshes long distances could decrease the efficiency of the automatic culling and the collision routines.


Drey(Posted 2004) [#3]
Yea, Vertices are local to the meshes center. I'm know a bit of DX itself and i've been starting up some research on it again. It seems u have something called a matrix world that probably gets updated every loop. So pivots or whatever probably have data that gets feed to the matrix world in DX.


Ross C(Posted 2004) [#4]
Yea :o) But surely vertices are only local if positionentity is used, instead of positionmesh. Anyway, i'm just thinking out load. Nice to hear ppls opinions on this. :o)


wizzlefish(Posted 2004) [#5]
(sorry for posting on an old thread)

Here's a structure:

ENTITY (the actual thing) |- MESH (visual)
                          |- SPACE (where it is (0,0,0)
ETC.


An entity is just a thing, and a mesh is assigned to a thing. That is why you call "blah=LoadMesh('blah.3ds')". "blah" is the ENTITY and "blah.3ds" is the MESH. A mesh is really just a child of an entity. And when calling "POSITIONENTITY" it positions the mesh.


wizzlefish(Posted 2004) [#6]
That's a lot of quotes.