Hi Fabric3D.. Do u have any code example..
On Feb 11, 2:23 am, Fabrice3D <[email protected]> wrote: > Hi Arul, > Why don't you try simple stuff like camera moveforward, rotate on mouse... > then if you can divide your floor in rectangles, use the native point in rect > check native to Flash to see if the destination x/z position is still inside > a given rectangle. > you also have the Collision class in extrusion package that triggers color > events. so if you draw map with say a red area where you element is, OnRed() > --> do something... > > There are so many ways.. but with just the combination of the two + radius > checks and distance, you can do a lot. > to draw your map, just make a top render and use it as template. > > Hope these can get you started > > Fabrice > > On Feb 10, 2010, at 5:23 PM, Arul wrote: > > > Hello all, > > I want to make a simple room... User can walk through the > > room.. With in the room i place small 3ds components ... so i use > > skybox... I dont know how to increase the width and height... is any > > other idea to make a room... > > > Previously i use SegmentsExtrude ... create floor and ceil using > > plane.. create other three faces using SegmentsExtrude .. But i dont > > know how to walk through the room using camera... Here i mentioned > > the Listeners.. using the listeners camera walk around the component.. > > does not go inside.. how to do this... > > > thanks > > arul > > > ------------------- > > CODE > > ------------------- > > > public function initObjects():void { > > var xPoints:Array = new Array(); > > xPoints.push(new Number3D(0, 0, 0)); > > xPoints.push(new Number3D(0, 0, wallwidth)); > > > var yPoints:Array = new Array(); > > yPoints.push(new Number3D(0, 0, 0)); > > yPoints.push(new Number3D(wallwidth, 0, 0)); > > > var zPoints:Array = new Array(); > > zPoints.push(new Number3D(wallwidth, 0, 0)); > > zPoints.push(new Number3D(wallwidth, 0, wallwidth)); > > > scene.addChild(createSegment(xPoints)); > > scene.addChild(createSegment(yPoints)); > > scene.addChild(createSegment(zPoints)); > > scene.addChild(createFloor()); > > scene.addChild(createCeil()); > > } > > > public function createSegment(aPoints:Array):SegmentsExtrude { > > //generate the wall > > var wallThickness:Number = 20; > > //aPoints.push(new Number3D(0, 0, 0)); > > > var segment:SegmentsExtrude = new > > SegmentsExtrude(aPoints, > > {coverall: false, axis: "y", offset: wallHeight, recenter: true, > > closepath: false, subdivision: 10, thickness_subdivision: 1, flip: > > false, thickness: wallThickness, bothsides: true, segmentsH: 24, > > segmentsW: 12, material: front}); > > segment.bothsides = true; > > > return segment; > > } > > > public function createFloor():Plane { > > var plane:Plane = new Plane({width: wallwidth, height: > > wallwidth, > > segmentsH: 24, segmentsW: 12, material: down}); > > plane.moveRight(wallwidth/2); > > plane.moveForward(wallwidth/2); > > plane.bothsides = true; > > return plane; > > } > > > public function onEnterFrame(e:Event):void { > > if (over){ > > camera.targetpanangle = 0.3 * (stage.mouseX - > > lastMouseX) + > > lastPanAngle; > > camera.targettiltangle = 0.3 * (stage.mouseY - > > lastMouseY) + > > lastTiltAngle; > > } > > camera.hover(); > > viewer.render(); > > } > > > private function onMouseOver(e:MouseEvent):void { > > over = true; > > lastMouseX = stage.mouseX; > > lastMouseY = stage.mouseY; > > lastPanAngle = camera.panangle; > > lastTiltAngle = camera.tiltangle; > > } > > > private function onMouseLeave(e:Event):void { > > over = false; > > } > > > public function createCeil():Plane { > > var plane:Plane = new Plane({width: wallwidth, height: > > wallwidth, > > segmentsH: 24, segmentsW: 12, material: up}); > > plane.moveRight(wallwidth/2); > > plane.moveForward(wallwidth/2); > > plane.moveUp(wallHeight); > > plane.bothsides = true; > > return plane; > > }
