Remove Overlapping Cube Faces

Software: Away3D 3.x

Tempy111, Sr. Member
Posted: 14 December 2015 11:22 AM   Total Posts: 133

Just wondering if it’s possible to remove Cube faces that will Always overlap and thus aren’t visible to the player.

I have a number of walls created as cube tiles but when two are next to each other (or sometimes even more) faces will become invisible to the player, so pointless to render them. however, there can be a bit of Z-sort problems with the side of a cube appearing above the top of the next door cube.

Apart from manually creating the cubes as a series of planes (which.. might be better.. or maybe a heigh map), I’m wondering if it is possible to just tell it not to render a set face?

   

Tempy111, Sr. Member
Posted: 19 December 2015 08:52 PM   Total Posts: 133   [ # 1 ]

okay.. I’ve tried a number of things so far including a couple of clipping types and renderer types but not too much help..

here is a current image.

okay.. it’s not the best really but if you look at top centre by the pink bunny’s head you will see a bit of the check board THROUGH the grass. that shouldn’t happen. it can show itself worse at times. it only seams to the that one side but the left side of a cube will always show through.

Not sure if it’s related but for the materials, in order to set the grass as the top, it needs to be set as bottom in the material.

slightly unrelated, but the Carrots are all wrong because if I stick them on the same spritesession as the walls and the bunny, after a few pixels, the whole of the session turns into a static image of what was on screen and it looks like the whole of that bit moves (the sky box shows movement, and the floor which is a plane on a different layer also moves).. if you understand that ^_^

 

   

Tempy111, Sr. Member
Posted: 19 December 2015 10:12 PM   Total Posts: 133   [ # 2 ]

Ah, fixed.. kinda.. makes a delay in loading but that’s not a major problem. instead of declaring reuseable materials and using it on the blocks, declare the materials in the loop that places the cubes. Make sure each face is a different material (even if the same texture is loaded) and just check if there is a cube next to it. if a cube, then make that sides texture’s alpha 0. that way, the side is invisible and doesn’t render and everything is nice and fine.

well.. now to deal with the MD2 layering ^_^

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X