This content has been marked as final. Show 6 replies
Yes, i think I had such a problem, Try setting the camera(from witch you are viewing) hither to a greater value.
w3d.camera(1).hither = 50
That solved my problem.
And if that doesn't work, try scaling the camera by a large factor like
10-20 or so.
sprite(the currentSpriteNum).camera.scale = vector(20,20,20)
If you build the scale of the world too small it can suffer from the
Z-buffer sorting issue, especially on older cards, and enlarging the
camera's viewing frustum can compensate for it.
Oops, sorry that should have read...
sprite(the currentSpriteNum).camera.transform.scale = vector(20,20,20)
Thanks for the quick replies. I remember that problem too danieloizo, and i solved scaling the camera and/or playing around with hither yon values.
In this case tweaking the camera makes no diference, i've tried. By unkowledge i didn't mention the part that the models with problems have transparency.
Fontunately i have found this thread on director-online that describes the cause of the problem(two transparent models, see the shckwave movie whitin).
Maybe there is a way to correct this z-buffer problem, or maybe not. I leave this thread open.
The problem is that models which have transparent textures are sorted per-model, by their geometric centre. Here's a detailed description of when and why the problem occurs:
The solution is to break the model down into separate parts, so that each part is sorted by its own geometric centre.
As a demo - here are 2 cubes, each sitting on opposite sides of a long wall:
Both the cubes and the wall have alpha textures with transparency. As the view rotates, each object is sorted only by its distance from the camera, causing the cubes to appear to 'pop' in front of and behind the wall as their geometric centre becomes closer/further to the camera than the wall's geometric centre.
In this fixed scene, the wall has been split into 3 separate models, thereby causing each separate piece to be sorted independantly by its geometric centre. This reduces the chance that a cube's centre will be closer to the camera than a wall which is supposed to occlude it.
If you watch carefully however, there are still moments where the sorting is incorrect and they overlap. This could be fixed by breaking up the wall into still smaller sections.
Increasing the 'hither' value of the camera is not the correct solution in this case. It is the correct solution to a different problem with overlapping models however, called 'z-fighting' : http://en.wikipedia.org/wiki/Z-fighting
hope this helps!
Very well explained duckets , It's good to know about this z-buffer problem.