elevation reader getlevel

Software: Away3D 3.x

jagguy, Newbie
Posted: 11 July 2011 01:23 AM   Total Posts: 27

I am not getting any Y value when I move over terrain.
The terrain display heightmap correctly.

//heightmap display OK
var terrainMaterial:BitmapMaterial =
  new BitmapMaterial(Cast.bitmap(Terrain));
 
  var elevation:Elevation = new Elevation();
 
  elevationReader= new ElevationReader();
 
  var vertices:Array= elevation.generate(
  Cast.bitmap(HeightMap),“r”,80,80,1,1,.25);
 
  elevationReader.traceLevels(
  Cast.bitmap(HeightMap),“r”,80,80,1,1,.25);
 
  extrude = new SkinExtrude(vertices,
    {
    coverall:true,material:terrainMaterial,recenter:true,bothsides:true
    }
  );
 
  extrude.rotationX = 90;
  extrude.x=extrude.y=extrude.z=0;
  extrude.y=10;
  view.scene.addChild(extrude);
 

//i move over terrain with hill and no change of y value
myplayer.yVal=elevationReader.getLevel(myplayer.playerMesh.x,-myplayer.playerMesh.z,-255*0.5*0.25 +  myplayer.hheight);
 
 
  myText2.text=“x=” +myplayer.playerMesh.x+ ” z=” + myplayer.playerMesh.z+ ” y value =” +myplayer.yVal;

   

jagguy, Newbie
Posted: 11 July 2011 01:00 PM   Total Posts: 27   [ # 1 ]

i have tried to google this and cant see my error

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X