Im整个papervision场景中的新类。 对于一个学校任务,我正在制作我自己的房间的全景版本,使用 一个有6张图片的立方体。它创造了全景,它效果很好。如何从另一个类'addChild'DisplayObject3d? (Papervision3d)
但现在我想添加可点击的对象。 的要求之一是我的代码是关注OOP的。这就是我现在正在尝试的。
目前我有两个班 - Main.as(这里我做全景立方体的房间) - photoWall.as(在这里我要创造我的第一个可点击的对象)
现在我的问题是:我想从photoWall.as 添加一个可点击的对象到我的全景房间。但他没有表现出来?我认为这与 有关。我在Main.as和photoWall.as中使用了一个新场景。没有错误或警告报告
这是photoWall.as一块是我想的addChild我对象(photoList):
private function portret():void
{
//defining my material for the clickable portret
var material : BitmapFileMaterial = new BitmapFileMaterial('images/room.jpg');
var material_list : MaterialsList = new MaterialsList({ front: material, back: material });
// I don't know if this is nessecary? that's my problem
scene = new Scene3D();
material.interactive = true;
// make the clickable object as a cube
var photoList : DisplayObject3D = new Cube(material_list, 1400, 1400, 1750, 1, 4, 4, 4);
// positioning
photoList.x = -1400;
photoList.y = -280;
photoList.z = 5000;
//mouse event
photoList.addEventListener(InteractiveScene3DEvent.OBJECT_CLICK, onPress);
// this is my problem! I cannot see 'photoList' within my scene!!!
scene.addChild(photoList);
// trace works, so the function must be loaded.
trace('function loaded');
}
希望你们能帮助我在这里。会很棒!
感谢,
桑德尔