Can you use the Flash10 version? if so you wouldn't have this problem any
more. If not, let me know.
-Pete

On Tue, Feb 16, 2010 at 1:29 PM, [email protected] <
[email protected]> wrote:

> How can I stop the textures in my little demo from distorting when at
> certain angles? I read it is necessary to add the triangle count, but
> how would I do this?
>
> Demo here:
> http://www.mind-probe.com/as3/away3d/camera3D/camera3d.html
>
> Source code:
>
> import away3d.cameras.*;
> import away3d.containers.*;
> import away3d.materials.*;
> import away3d.primitives.*
> import away3d.lights.DirectionalLight3D
>
> import jiglib.physics.RigidBody;
> import jiglib.plugin.away3d.Away3DPhysics;
> import jiglib.plugin.away3d.Away3dMesh;
> import jiglib.math.JNumber3D
>
>
> var scene:Scene3D;
> var camera:HoverCamera3D;
> var view:View3D;
> var light:DirectionalLight3D;
> var physics:Away3DPhysics;
>
>
> var boxWidth:Number = 250
> var boxHeight:Number = 30
> var boxDepth:Number = 250
> var boxThickness:Number = 5
>
> var diceTextures:Array = [ new WhiteShadingBitmapMaterial( new
> diceTexture1(0,0) ),
>                                                   new
> WhiteShadingBitmapMaterial( new diceTexture2(0,0) ),
>                                                   new
> WhiteShadingBitmapMaterial( new diceTexture3(0,0) ),
>                                                   new
> WhiteShadingBitmapMaterial( new diceTexture4(0,0) ),
>                                                   new
> WhiteShadingBitmapMaterial( new diceTexture5(0,0) ),
>                                                   new
> WhiteShadingBitmapMaterial( new diceTexture6(0,0) ) ]
>
>
>
> var wallTexture:WhiteShadingBitmapMaterial = new
> WhiteShadingBitmapMaterial( new walltexture(0,0))
> var groundTexture:WhiteShadingBitmapMaterial = new
> WhiteShadingBitmapMaterial( new groundtexture(0,0))
>
> var diceScale:Number = 30
> var dices:Array = new Array()
> var diceRandomForce:Number = 50
>
> function initAway3D():void {
>        scene = new Scene3D();
>
>        camera = new HoverCamera3D();
>        camera.distance = 400
>
>        light = new DirectionalLight3D({color:0xFFFFFF, ambient:0.25,
> diffuse:
> 0.75, specular:0.9})
>        scene.addChild(light)
>
>        view=new View3D({scene:scene,camera:camera});
>        view.x=stage.stageWidth/2;
>        view.y=stage.stageHeight/2;
>        addChild(view);
>
>        physics = new Away3DPhysics(view,4)
>
> }
>
>
> function createDice():void {
>        var dice:RigidBody = physics.createCube({width:180, height:90,
> depth:
> 30});
>        dice.y=500
>        dice.movable=true
>
>        Cube(Away3dMesh(dice.skin).mesh).cubeMaterials.left =
> diceTextures[0]
>        Cube(Away3dMesh(dice.skin).mesh).cubeMaterials.right =
> diceTextures[1]
>        Cube(Away3dMesh(dice.skin).mesh).cubeMaterials.front =
> diceTextures[2]
>        Cube(Away3dMesh(dice.skin).mesh).cubeMaterials.back =
> diceTextures[3]
>        Cube(Away3dMesh(dice.skin).mesh).cubeMaterials.top = diceTextures[4]
>        Cube(Away3dMesh(dice.skin).mesh).cubeMaterials.bottom =
> diceTextures[5]
>        dices.push(dice)
> }
>
> function initListeners():void {
>        stage.addEventListener(Event.ENTER_FRAME, render);
> }
>
> function render( e:Event ):void {
>        view.render();
>        camera.targetpanangle = stage.mouseX/stage.stageWidth*360
>        camera.targettiltangle = stage.mouseY/stage.stageHeight*30
>        camera.hover();
>        //physics.step();
>
>        light.x = camera.x
>        light.y = camera.y
>        light.z = camera.z
> }
>
> initAway3D();
> createDice();
> initListeners();
>



-- 
___________________

Actionscript 3.0 Flash 3D Graphics Engine

HTTP://AWAY3D.COM

Reply via email to