[Papervision3D] interactive materials
Francisco Murillo
fmurillo at gmail.com
Tue Jun 17 09:17:05 PDT 2008
a link or something??
2008/6/16 Francisco Murillo <fmurillo at gmail.com>:
> Hi all...
> can anyone guide me on how could I put a button inside a face of this cube,
> and.. by example, a movieclip with an image that when I press the button,
> the image changes.... that simple.. please.... thanks
>
>
>
>
>
>
> package {
>
> //_________________________________________
> //
> import flash.display.*;
> import flash.events.*;
> import flash.filters.GradientGlowFilter;
>
> //filmed in papervision3D - 2.0a ((codename : great white))
> import org.papervision3d.view.*;
> import org.papervision3d.scenes.*;
> import org.papervision3d.events.*;
> import org.papervision3d.render.*;
> import org.papervision3d.lights.*;
> import org.papervision3d.cameras.*;
> import org.papervision3d.materials.utils.*;
> import org.papervision3d.objects.primitives.*;
> import org.papervision3d.materials.shadematerials.*;
> //--------------------------------------------------
>
>
>
> public class FlatShadeMaterialDemo extends MovieClip {
> //_________________________________________
> // varz
> private var glowFilter:GradientGlowFilter = new GradientGlowFilter
> (0, 45, [0xf0f0f0, 0xf0f0f0, 0xf0f0f0], [0, 0.5, 1], [0x00, 0x50, 0xff], 8,
> 8, 10, 1, "outer", false);
>
> //_________________________________________
> // constructor
> private var scene :Scene3D;
> private var cam :Camera3D;
> private var view :Viewport3D;
> private var renderer :BasicRenderEngine;
> private var thelight :PointLight3D;
> private var cube_mc :Cube;
>
> public function FlatShadeMaterialDemo():void {
> init3D();
> }
> private function init3D():void {
> stage.align = StageAlign.TOP_LEFT;
> stage.quality = StageQuality.BEST
> stage.scaleMode = StageScaleMode.NO_SCALE;
>
> //setup 3D scene
> scene = new Scene3D();
> cam= new Camera3D(null, 8, 100);
> view = new Viewport3D(this.width, this.height, true);
> addChild(view);
> renderer = new BasicRenderEngine();
>
> //create lighting
> thelight = new PointLight3D(true);
> thelight.x= -1000;
> thelight.y= 0;
> thelight.z= -1200;
> //scene.addChild(thelight);
> //normally you dont need this, but to make it visible, you
> do...
>
> //setup form
> //create 3D object
> cube_mc = new Cube(new MaterialsList({all:new
> FlatShadeMaterial(thelight, 0xDE0000, 0x800000)}), 250, 550, 100);
>
> cube_mc.rotationX= 50;
> cube_mc.rotationZ= 90;
>
>
> cube_mc.rotationY= -12;
>
> scene.addChild(cube_mc);
>
> this.filters = [glowFilter];
> //start render loop
> addEventListener(Event.ENTER_FRAME, loop3D);
> //resizer
> //addEventListener(ResizeEvent.RESIZE, resize);
> }
> //_________________________________________
> // render loop
> private function loop3D(e:Event):void {
>
> //rotate 3D object
> //cube_mc.pitch(1);
> //cube_mc.yaw(1);
> //render scene
> renderer.renderScene(scene, cam, view);
> }
>
>
> }
> }
>
>
> ---------------------------------------------------
> Francisco Murillo C.
> (506) 8389-2177
> http://www.frazko.com
--
---------------------------------------------------
Francisco Murillo C.
(506) 8389-2177
http://www.frazko.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20080617/7a5fdf6d/attachment.html
More information about the Papervision3D
mailing list