yes the SkinExtrude needs a multidimentional array
but the Eleavtion class does it for you.
Now you pass a third level, in witch there is only one array. and the
one the class needs are nested into that array
Since the generation needs a series of points "from" and a series
"to". The ocde thinks there is only "from".
try
var sknExtrd:SkinExtrude = new
SkinExtrude(elev.generate(source_elevation, "r", 5, 5, 10, 1,1),
{ material:source_elevation,
bothsides:true, flip:false, subdivision:2, scaling:-1,coverall:true,
recenter:true, closepath:false } );
Fabrice
On Feb 15, 2009, at 4:59 PM, AJF wrote:
Thank you for posting back Fabrice: I added the trident as you
suggested for some perspective.In my origanal post you should see that
the camera is "looking at" the "sknExtrd.position", and
"bothsides:true" is also in there.I did some more testing and it seems
as thou the [pnts] is not getting to or read (or something) by the
SkinExtrude. I put some traces() in and this is the results:trace
(sknExtrd.faces.length)//0 ,, trace(sknExtrd.vertices.length)//0 ,,
I'm not that great at AS3 but it looks to me if there was something
showing up, there would not be 0's. I'm not familiar with the Extrude
class so I looked at the class file(2.1v) still not sure of the
requirements for an extrusion to happen, 2 sets of points? Anything
you can tell me will be of great help, and thanks for taking the time
to look at this. Keep up the great work on this awesome engine :)
On Feb 14, 4:13 pm, Fabrice <[email protected]> wrote:
to make sure you render something...
import away3d.primitives.trident;
in your code
view.scene.addChild(new Trident());
if you want render once only, I see no enterframe event..
just ask the camera to point at this trident. Its set to 0,0,0
view.camera.lookAt(new Number3D());
if at this point you should see the trident, but may be not the
elevation:
lookAt(sknExtrd.position);
If you still see nothing, set to sknExtrd the property bothsides:true
if you now see something, just set back to false and set flip:true.
Hope its helps a bit in the darkness :)
Fabrice
On Feb 14, 2009, at 8:54 PM, AJF wrote:
Hey All, I can not get anything to display and I have played around
with this for days now. I'm using ver 2.1. I am probably missing
something simple but I just don't know what, any help for a dumb
farmer would be awesome. Thanxs
public class SknExtr extends Sprite
{
[Embed(source='../lib/earth.png')]
public var EarthMap:Class;
[Embed(source='../lib/Red1.png')]
public var RedEarth:Class;
public function SknExtr()
{
var scene:Scene3D = new Scene3D();
var camera:Camera3D = new Camera3D();
var view:View3D = new View3D( { scene:scene,
camera:camera } );
view.x = stage.stageWidth / 2;
view.y = stage.stageHeight / 2;
addChild(view);
var source_elevation:BitmapData =
Cast.bitmap(RedEarth);
var redErMat:BitmapMaterial = new
BitmapMaterial(Cast.bitmap
(EarthMap));
var elev:Elevation = new Elevation();
var pnts:Array =
elev.generate(source_elevation, "r", 5, 5, 10, 1,
1);
var sknExtrd:SkinExtrude = new
SkinExtrude([pnts],
{ material:source_elevation,
bothsides:true, flip:false, subdivision:2,
scaling:-1,
coverall:true, recenter:true,
closepath:false } );
trace(pnts);//x:0 y:233 z:89,x:50 y:233 z:95,x:
100 y:233 z:102,x:
150 y:233 z:138,etc...
sknExtrd.x = sknExtrd.y = sknExtrd.z = 10;
(sknExtrd as Mesh).pushback = true;
view.scene.addChild(sknExtrd);
view.camera.lookAt(sknExtrd.position);
view.render();
trace(sknExtrd.position);//x:10 y:10 z:10
}
}
}- Hide quoted text -
- Show quoted text -