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;

Reply via email to