Hello to all,

Sorry for my english (i'm a frenchman), i'm not very good but i try...

I began investigating Away3D (3.6) with flash cs4 on Mac Os 10.5.

1) I created a scene where there are 3 objects connected by a tube. If
I place the cam above : no problem

2) If I deplace the cam, the pers is false and object do not contact
any more

3) And when i put the swf on web, it's not like the swf on my machine
(safari and Shockwave Flash 10.1 r102 ).

You can see the image of this 3 things here :

http://www.fabriceb.fr/divers/3dVisu.html

And the code :

import away3d.containers.View3D;
import away3d.materials.ColorMaterial;
import away3d.primitives.Cube;
import away3d.primitives.Sphere;
import away3d.core.render.Renderer;
import away3d.lights.*;
import away3d.materials.ShadingColorMaterial;
import away3d.materials.WhiteShadingBitmapMaterial;
import away3d.cameras.Camera3D;
import away3d.cameras.TargetCamera3D;
import away3d.materials.PhongBitmapMaterial;
import away3d.events.MouseEvent3D;
import away3d.containers.ObjectContainer3D;
import away3d.primitives.Trident;
import away3d.containers.Scene3D;
import away3d.core.base.Object3D;


stop();

//3d variables :
//viewport
var view:View3D;
//objets
var cube_00:Cube;
var cube_01:Sphere;
var cube_02:Cube;
var cube_03:Cube;
var group:ObjectContainer3D;
//camera
var cam:Camera3D;

//materiaux
var essai3dTexture:Essai3d=new Essai3d(0,0);
var colorMaterial_00:ShadingColorMaterial=new
ShadingColorMaterial(0xB52A22);
var colorMaterial_02:PhongBitmapMaterial=new
PhongBitmapMaterial(essai3dTexture);

// create a viewport
view=new View3D({x:550/2,y:
400/2});//,renderer:Renderer.INTERSECTING_OBJECTS
addChild(view);

//create a trident
view.scene.addChild(new Trident(300, true));

// create a basic camera
cam=new Camera3D({x:1,y:300,z:0,zoom:50,focus:50});
cam.lookAt(new Vector3D(0,0,0));
view.camera=cam;


// create a new Ambient light source with specific ambient  parameters
var lightAmbientLight3D:AmbientLight3D=new AmbientLight3D({ambient:
1,color:0xfff23f});
view.scene.addLight(lightAmbientLight3D);


// Create a group and add to scene
group = new ObjectContainer3D();
view.scene.addChild(group);

// create a cube and put it on stage (view.scene) or on group (group)
cube_00=new Cube({x:-400,y:0,z:0,width:100,height:100,depth:
100,material:colorMaterial_02});//,material:colorMaterial_00
cube_01=new Sphere({x:0,y:0,z:0,radius:100,segmentsW:20,segmentsH:
20,material:colorMaterial_02});
cube_02=new Cube({x:400,y:0,z:0,width:100,height:100,depth:
100,material:colorMaterial_02});
cube_03=new Cube({x:0,y:0,z:0,width:800,height:10,depth:
10,material:colorMaterial_02});
group.addChild(cube_03);
group.addChild(cube_00);
group.addChild(cube_01);
group.addChild(cube_02);


// Initialise frame-enter loop
addEventListener(Event.ENTER_FRAME, loop);
function loop(event:Event):void {
        //group.yaw(2)

        // rotate the objects
        cube_00.yaw(-4);
        cube_01.yaw(-4);
        cube_02.yaw(-4);

        // Render the 3D scene
        view.render();
}

Can you tell me where is the problem ?

Thanks

Reply via email to