z order wierdness

Blitz3D Forums/Blitz3D Beginners Area/z order wierdness

Shifty Geezer(Posted 2005) [#1]
Can someone explain this. I've an orthographic camera at (0,0,-10000). I've a few sprites (textured quads) alpha blended. Now I've one positioned at (x,y,-9999) and another at (x,y,-9991). Ordinarily the one at -9991 is in front of the other. But when positioned in the lower end of the screen, the sprite at -9999 is drawn above the one at -9991. How come Blitz's drawing order is so wrong when the different in z positions is fairly substantial?


VIP3R(Posted 2005) [#2]
Hey Shifty, I don't know for sure but your problem may be related to this bug...

http://www.blitzmax.com/Community/posts.php?topic=49552


Shifty Geezer(Posted 2005) [#3]
Unlikely. I'm using custom quads and just positioning them with PositionEntity. I'm not using Sprite commands. Unless this Z order bug affects all 2D meshes somehow?


VIP3R(Posted 2005) [#4]
Dunno, the sprite bug looks like it's something to do with the z ordering. Maybe this bug could be affecting more than just the sprites alone like you say.

Have you tried your code with Blitz3D V1.88? Then we'll know for sure, as that didn't have the sprite z ordering problems.


Stevie G(Posted 2005) [#5]
Shifty,

The problem is with the ortho view. I always had z-order issues no matter what I did. I think it's badly implemented tbh. Go for the tried and tested solution of positioning the camera far from the scene and zooming right in ... gives you much the same effect without the z-order issues.

Stevie


WolRon(Posted 2005) [#6]
The z-order begins to fail at over 10,000 units, so try to stay under that.


Shifty Geezer(Posted 2005) [#7]
Okay WolRon.
Stevie : Have to use ortho for pixel perfect UI. Entity coordinates match Screen-pixels exactly.


Shifty Geezer(Posted 2005) [#8]
Wolron : didn't work. I've determnied Orthographics camera's are knackered. The Z order bug persists at a distance of -1000. Worse still if I use a positive value it shrinks the view, basically zooming out, and camerazoom nor changing camera parameters doesn't zoom in. I even had an occassion where a quad drawn at mouse coordinates actually drew twice simultaneously on the screen, one at screen coords and the other in the 'zoomed out' position!

I can workaround this problem using larger distances between layers of UI thankfully, but it's discouraging.


Stevie G(Posted 2005) [#9]

Stevie : Have to use ortho for pixel perfect UI. Entity coordinates match Screen-pixels exactly.



No you don't. I don't use an ortho camera and I have my own pixel perfect gui systems going on in most of my stuff.

Stevie


big10p(Posted 2005) [#10]
Does changing to using a WBuffer help?


Shifty Geezer(Posted 2005) [#11]
big10p : Dunno about that but the docs say it might have compatibility issues and i'm aiming for low tech so don't feel I can risk it

Stevie G : Can I see your camera setup to get a pixel accurate perspective view please? Presumably it also works in different resolutions?

Also how can it provide the same pixel accurate display with objects at different resolutions? Unless you have an ENORMOUS zone objects nearer the camera will appear bigger. I'm curious...