Terrain Issue

Marnok

19-04-2008 03:35:36

Hi All,

First off, my thanks to Betajaen for creating NxOgre in the first place. For the most part I've found it to be very powerful and easy to use.

But, I'm relatively new to NxOgre and PhysX and I'm trying to get a heightmap terrain in-engine using the 'createTerrainFromWorldGeometry' function from this thread http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=2013&highlight=terrain

I'm running the 0.9 version of NxOgre I pulled off the SVN less than a month ago.

Everything works out great except for the positioning of the terrain itself. Now, I realize that it's static and that you can't really move it once it's created, but isn't the 3rd parameter (pose) supposed to let you specify where the terrain gets created? Seems like no matter what I do the far left corner of the terrain is placed at 0,0,0.

I have a feeling I'm missing something simple, but I've searched these forums as well as the PhysX ones and not found an answer.

Here's the code I'm using to call the function. Like I said though, it doesn't really seem to matter what I put in the 3rd parameter.
NxOgre::Actor* mTerrain=createTerrainFromWorldGeometry("negrisle.cfg", gScene,Vector(100,0,100));
Any help would be appreciated because this is really getting frustrating.

Here's the Ogre terrain config file I'm using:
# The main world texture (if you wish the terrain manager to create a material for you)
WorldTexture=negrisle_texture.jpg

# The detail texture (if you wish the terrain manager to create a material for you)
DetailTexture=terrain_detail.jpg

#number of times the detail texture will tile in a terrain tile
DetailTile=3

# Heightmap source
PageSource=Heightmap

# Heightmap-source specific settings
Heightmap.image=negrisle.png

# If you use RAW, fill in the below too
# RAW-specific setting - size (horizontal/vertical)
#Heightmap.raw.size=513
# RAW-specific setting - bytes per pixel (1 = 8bit, 2=16bit)
#Heightmap.raw.bpp=2

# How large is a page of tiles (in vertices)? Must be (2^n)+1
PageSize=1281

# How large is each tile? Must be (2^n)+1 and be smaller than PageSize
TileSize=65

# The maximum error allowed when determining which LOD to use
MaxPixelError=3

# The size of a terrain page, in world units
PageWorldX=1500
PageWorldZ=1500
# Maximum height of the terrain
MaxHeight=98

# Upper LOD limit
MaxMipMapLevel=5

#VertexNormals=yes
#VertexColors=yes
#UseTriStrips=yes

# Use vertex program to morph LODs, if available
VertexProgramMorph=yes

# The proportional distance range at which the LOD morph starts to take effect
# This is as a proportion of the distance between the current LODs effective range,
# and the effective range of the next lower LOD
LODMorphStart=0.2

# This following section is for if you want to provide your own terrain shading routine
# Note that since you define your textures within the material this makes the
# WorldTexture and DetailTexture settings redundant

# The name of the vertex program parameter you wish to bind the morph LOD factor to
# this is 0 when there is no adjustment (highest) to 1 when the morph takes it completely
# to the same position as the next lower LOD
# USE THIS IF YOU USE HIGH-LEVEL VERTEX PROGRAMS WITH LOD MORPHING
#MorphLODFactorParamName=morphFactor

# The index of the vertex program parameter you wish to bind the morph LOD factor to
# this is 0 when there is no adjustment (highest) to 1 when the morph takes it completely
# to the same position as the next lower LOD
# USE THIS IF YOU USE ASSEMBLER VERTEX PROGRAMS WITH LOD MORPHING
#MorphLODFactorParamIndex=4

# The name of the material you will define to shade the terrain
#CustomMaterialName=TestTerrainMaterial

FriedChicken

22-04-2008 10:36:41

3rd parameter seems to be the position of collision model instead of terrain mesh , I think.

Marnok

22-04-2008 23:06:36

3rd parameter seems to be the position of collision model instead of terrain mesh , I think.

I think you may be right. It seems like the terrain would lose it's rigidity like the collision was moving out of place when I tried to position it in certain places. I suppose I should break down and look into setting up the remote debugger so I can see for sure.

It does appear that NxOgre doesn't like negative coordinates on the X or Z plane though. Every time I tried to position a body such that part of it would extend into negative territory it wouldn't display. Is that normal behavior?

I'll see about the debugger and post what I find.