Hey Wessness,
some picts would help. I'm not certain, I understand your problem.
is it the elevation on itself or the material?

May be asking the camera to lookat the extrusion would help a bit...

Fabrice

On Jun 9, 2009, at 7:10 AM, Wessness wrote:


I am having problems making my scene work properly.

I have gotten it to show up but it just shows me a corner of a flat
image for my visual material. Can't see that's it's rendering any
polygons or using my elevation map. Maybe something wrong in my code?
Am I missing a vital part here? When I uncomment my       //
extrude.rotationX = 90;    it disappears, so I assume something is
working correctly. Any help is much appreciated. I'm still very new to
3D in flash and this API.

Thanks!

import flash.display.*;
import flash.display.BitmapData;
import flash.events.*;
import flash.utils.*;
import away3d.cameras.*;
import away3d.containers.*;
import away3d.materials.*;
import away3d.primitives.*;
import away3d.core.*;
import away3d.extrusions.Elevation;
import away3d.extrusions.SkinExtrude;

//vars
var cam:Camera3D;
var View:View3D;
var scene:Scene3D;

// scene
scene = new Scene3D();
// cam
cam = new Camera3D();
cam.z = -1000;

// viewport
View = new View3D({scene:scene,camera:cam,x:250,y:200});
addChild(View);

function imageFromLib(source_ID:String):BitmapData
        {
                var classRef:Class = getDefinitionByName(source_ID)as Class;
                return new classRef(classRef.width, classRef.height);
        }

var source_elevation:BitmapData=imageFromLib("elevation1");
var mat:IMaterial = new BitmapMaterial(imageFromLib("visual1") ,
{smooth:true});
var elevate:Elevation = new Elevation();
var extrude:SkinExtrude = new SkinExtrude(elevate.generate
(source_elevation,"r",5,5,50,50,4),
{material:mat,recenter:true,closepath:false,coverall:true,subdivision:
1,bothsides:false,flip:true});
//extrude.rotationX = 90;
View.scene.addChild(extrude);

View.render();

Reply via email to