How do I get ride off the steps in my terrain?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
BoBtheREapER
Posts: 12
Joined: Thu Apr 20, 2006 6:10 pm
Location: Melle, Germany

How do I get ride off the steps in my terrain?

Post by BoBtheREapER »

I've got a problem with my terrain. There are thos "steps" and they really piss me off.

Image
Has anyone an idea how to get ride of them? Here is the code:

Code: Select all


HMap = "../GRAPHICS/Planet-Terrain/hm1.bmp";
MainTerrain = smgr->addTerrainSceneNode(HMap.c_str(),smgr->getRootSceneNode(),0,vector3df(this->MovementBox.MinEdge.X,-200, this->MovementBox.MinEdge.Z),vector3df(0,0,0),Scal,SColor(0,0,0,0),4,ETPS_9,0); 
MainTerrain->setAutomaticCulling(EAC_FRUSTUM_BOX);  
MainTerrain->setMaterialTexture(0, driver->getTexture("texture"));
MainTerrain->setMaterialType(video::EMT_DETAIL_MAP);
MainTerrainSelector = smgr->createTerrainTriangleSelector(MainTerrain, 0); 
Thanks for your help.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Are you talking about the big jagged edges along the edge of the terrain?You see those because the verticies on the edge of your terrain have different heights.

Take a sheet of paper and fold it like an accordion/fan. If you look at the sheet from directly above, the edge will look flat. If you look at it from the edge it will look like VVVVV. Now look at the sheet from the same angle as your screenshot. See the big jaggies? If you want to eliminate those edges you need to modify your heightmap to have consistent height along the edges.

Travis
BoBtheREapER
Posts: 12
Joined: Thu Apr 20, 2006 6:10 pm
Location: Melle, Germany

Post by BoBtheREapER »

I'm talking about the edges at the right border.
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

Can you provide that screenshot in Wireframe please?
Image
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

From what I'm seeing in the image you've posted everything looks normal. Maybe I'm missing something...

How big is your heightmap image [in pixels]?
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

I'm thinking the same things as you Vitek, just thinking how to prove it to him. It's either a heightmap that does not have 2^N+1 dimensions or it's just the view angle of the edge of the terrain.
Image
BoBtheREapER
Posts: 12
Joined: Thu Apr 20, 2006 6:10 pm
Location: Melle, Germany

Post by BoBtheREapER »

my texture is 257*257. How do I draw the wireframe?
Frodenius
Posts: 64
Joined: Sun Aug 29, 2004 11:24 am
Location: Germany/Frankfurt
Contact:

Post by Frodenius »

Code: Select all

material->Wireframe = true;
worst programming style ever seen...
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Actually, it would be...

Code: Select all

MainTerrain->setMaterialFlag(video::EMF_WIREFRAME, true);
You can't do 257x257 heightmaps without using 32-bit indices. The largest terrain heightmap that you can use with an unmodified Irrlicht is 129x129.
BoBtheREapER
Posts: 12
Joined: Thu Apr 20, 2006 6:10 pm
Location: Melle, Germany

Post by BoBtheREapER »

First thanks for your help.

Somehow the "steps" are gone. But that for a complete "row" seems to lack.

Image
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

Did you try 256x256? You can't, it must be 2^N+1( 17, 33, 65, 129 ). 257 would be the next possible, but that requires 32 bit indices.
Image
BoBtheREapER
Posts: 12
Joined: Thu Apr 20, 2006 6:10 pm
Location: Melle, Germany

Post by BoBtheREapER »

I've tried 256*256 but it only got me problems. How do I use32bit indieces?
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

will have to patch( hybrids patch site had a patch for 32 indices, not sure if it will still work with 1.3 ), or use IRRspintz.
Image
hockey97
Posts: 41
Joined: Mon May 14, 2007 10:47 pm

Post by hockey97 »

Hi is their a way to make in game a one flat leveled terrain and use the mouse to raise the tarrian or lower it, I would know that the mouse would be playing with the 3d model's faces and vertexe's.

Is it possible in Irrlicht??? or is it a harder to do kind of thing??
Dances
Posts: 454
Joined: Sat Jul 02, 2005 1:45 am
Location: Canada
Contact:

Post by Dances »

You'd have to pick your vertices with the mouse and then adjust their position in the mesh... somewhat advanced.
Post Reply