1)
//--loading *.3DS--
loader = Max3DS.load("Bandersha.3DS", {loadersize:40,
centerMeshes:true}) as LoaderCube;
loader = new LoaderCube();
max3ds = new Max3DS();
loader.loadGeometry("Bandersha.3DS", max3ds);
loader.scale(0.2);
//loader.x=-25;
//loader.y=-4;
loader.rotationX=90;
scene.addChild(loader);
2)
[Embed(source="robot.3DS",
mimeType="application/octet-stream")]
private var F360:Class;
...
model=new ObjectContainer3D();
model=(Max3DS.parse(F360, {ownCanvas:true,
centerMeshes:true,
pushfront:true}) as ObjectContainer3D);
view.scene.addChild(model);
3)
[Embed(source="hang2/hang2.png")]
private static const hang2Material:Class;
...
//--loading *.Md2--
loader2=new LoaderCube();
md2=new Md2();
md2.material=new BitmapMaterial(Cast.bitmap(new
Models3D.hang2Material()), {smooth: true});
md2.scaling=10;
loader2.loadGeometry("hang2/HANG2.md2", md2);
loader2.z=-300;
loader2.y=-200;
scene.addChild(loader2);
4)
[Embed(source="hang2/HANG2.md2",
mimeType="application/octet-stream")]
private static const hang2Model:Class;
[Embed(source="hang2/hang2.png")]
private static const hang2Material:Class;
...
//--another way of loading *.Md2--
var hang2:Mesh = Md2.parse(Cast.bytearray(new
Models3D.hang2Model()));
hang2.scale(0.06);
hang2.rotationY=90;
hang2.y=-150;
hang2.material = new BitmapMaterial(Cast.bitmap(new
Models3D.hang2Material()), {smooth: true});
scene.addChild(hang2);
Here "Models3D" - is the name of your class.
On 17 фев, 10:08, Dan <[email protected]> wrote:
> Dear all,
>
> I was looking at some of the examples for loading obj files and also
> 3ds files but they dont seem to work with the current version of
> away3d.
>
> I have a sphere to which i have mapped a photo texture. I am now
> trying to load a simple 3d model and attach it on the sphere.
>
> None of the examples i have found so far dont work.
>
> Could anyone please point us to a working example of maybe a code
> snippet that would illustrate how to load a simple 3d model - obj or
> 3ds.
>
> Thank you for your help.
>
> Sincerely