possible to remove faces from a terrain elevation?

Software: Away3D 4.x

alpoman, Jr. Member
Posted: 01 December 2015 05:06 PM   Total Posts: 40

Hello, is it possible to remove faces from a terrain elevation?
I would like to remove the lowest y-faces to make ‘holes’ in my terrain.  I also considered making a plane that would mask the terrain or its material and place it slightly above the bottom y-plane of terrain.  dont know how to do that either;)  If anyone has an idea, I’d really appreciate the help,

andy

here are two pics of my terrain, the first is the actual, the second shows the faces I would like to erase, photoshopped in red,

 

   

Tempy111, Sr. Member
Posted: 01 December 2015 06:35 PM   Total Posts: 133   [ # 1 ]

Since I don’t use 4, I can only be of limited use, but since this place seams pretty dead for the past year, I’ll try.

What would happen if you used a png as the terrain map and made the low area’s transparent? Or the trick some old-ish games use, make the low bits REALLY LOW and have them black or something to look like deep darkness. very few games I can think of with bottomless pits, don’t have a bottom which is just set low down with some blockers or kill contact points in the way.

I’m not sure how either of these would work out or help you much though.

 

   

Avatar
Fabrice Closier, Administrator
Posted: 01 December 2015 07:38 PM   Total Posts: 1265   [ # 2 ]

compair each face generation with a plane3d 0,1,0. where the plane3d position y is the same y where you want to ‘cut’. if one or two of the vertices is behind the plane. (so bellow your y), build the face using y of the plane by connecting either one or two vertices to the one or two above. using the class, x and z remain unchanged. if 3 are behind plane, ignore the face.
You can use a png to color the mesh, but to do this, the png acts as a depth map, and this means that unless you map the mesh by hand, you will have stretched textures along the vertical side of this terrain. Not to mention that the png may need to be massive if you go near of the geometry.
Another option is to write a method and add it to material, where all values bellow a certain y do not get rendered. the plus being that the geom stays intact, and you can change the y dynamically.

 

   

Tempy111, Sr. Member
Posted: 01 December 2015 07:53 PM   Total Posts: 133   [ # 3 ]

I would have thought re-connecting Vertex points would be a bit tricky dynamically without running the risk of bad polygon’s.. telling it just not to render that face seams the best option I think..

I guess Jpg is always better for an height map cause any artifacting helps to give a more natural appearance.

Of course would you be able to give a much better answer, being a team member ^_^

 

   

alpoman, Jr. Member
Posted: 01 December 2015 08:37 PM   Total Posts: 40   [ # 4 ]

Wow, these are great answers - thanks!!!!
I tend to think that keeping the geometry intact is good, so I’ll start there.
I tried making my bitmapdata for terrain transparent (using true parameter), and if I set my terrainMaterial to alphaBlending=true, it almost works.

//bitmap
myBitmapData = new BitmapData(256,256,true,0x000000);
myBitmapData.draw(mcontainer); //draw contents of sprite to bitmpData
myBitmap = new Bitmap(myBitmapData);
///creat terrain
terrainMaterial = new TextureMaterial(Cast.bitmapTexture(myBitmap),true,false,true);//HeightMap
terrainMaterial.lightPicker=lightPicker
terrainMaterial.ambient =16;//3
terrainMaterial.specular = .2;//.3
terrainMaterial.ambientColor=colarr[col]
terrainMaterial.alphaBlending=true


Doing this, The bottom layer DOES dissapear, but so do some of the higher elevations in weird striations, but only when viewing mesh from certain panAngles, weird. 

Oh, the reason I want that transparnet is to creat non-rectangular terrains in general, and to have transparent water at y=0 without seeing the rectangle bottom;)

 

   

Tempy111, Sr. Member
Posted: 01 December 2015 09:12 PM   Total Posts: 133   [ # 5 ]

Z-sort issue? or maybe clipping…

 

   
   
‹‹ MD2 animation Null?

X

Away3D Forum

Member Login

Username

Password

Remember_me



X