z-ordering: by entity or vertex?
Blitz3D Forums/Blitz3D Programming/z-ordering: by entity or vertex?
| ||
I've just noticed that when I create an entity by creating a mesh and its associated surfaces and vertices, the entity's position relative to the camera is always 1U. Something that would've been useful to know beforehand to take into account for moving the entity about, eh? At any rate, if I have an entity whose vertices are all at least 10U away, even though the entity itself is defined as being 1U away by default, will this affect the proper z-ordering of things? (I've already discovered it affects the clipping, so clipping must be figured by entity position.) |
| ||
z-ordering is per-entity. z-BUFFERING is per pixel though, so as long as you're not using any alpha effects it makes no practical difference. Dunno what you're on about with cameras - I don't think the position of cameras influence anything unless the object is parented to them. |
| ||
Hrm, good point. What's the default camera position? 0, 0, 0? 'Cuz the meshes wind up at 0, 0, 1 which is the perfect place to be just in range of the center of the default camera. (And I was using PositionEntity to figure this mess out, so it's not all relative) : remember, I built the mesh in the program from vertices... is AddVertex camera relative? : |
| ||
PositionEntity is relative unless you set the Global flag to True. Anyway that isn't used to figure out an entity's position, it is used to move an entity to a new position. Maybe you should post your code because it is starting to sound like you are moving the entity without realizing it. Unless parented to something else everything starts out at 0,0,0 world coordinates (eg. loaded models are placed there, created cameras are placed there, etc.) |
| ||
What happened is: First I wanted to move it, but when I did the results were odd. Then I changed the line to move it a bit to see what would happen. Eventually I arrived at PositionEntity 0,0,1, which left it in the identical spot as commenting the move out. Neither the entity nor the camera are moved otherwise. The camera is never moved, and the entity has just been created. The entity was created from various vertices all at X, Y, 10. So I assumed the finished entity would be at 10. This was not the case. |
| ||
Actually, I would expect the entity to be at 0,0,0 regardless of where the individual vertices are. Better to create the vertices at x,y,0 and then move the entity back to 0,0,10. Still it's weird if it really is creating it at 0,0,1 though. |