[prev in list] [next in list] [prev in thread] [next in thread]
List: osflash-sandy
Subject: [Sandy] [sandy commit] r196 -
From: codesite-noreply () google ! com (codesite-noreply () google ! com)
Date: 2007-04-25 7:40:35
Message-ID: c09ffb4bcf042eeb048a4dc9a8382 () google ! com
[Download RAW message or body]
Author: kiroukou
Date: Wed Apr 25 00:40:18 2007
New Revision: 196
Modified:
trunk/sandy/as2/branches/2_0/tests/spriteTest/src/SpriteTest.as
Log:
Little update of the Sprite test.
Performance are in fact interessting, but can certainly be optimized bit more.
Next step, integration of Sprite3D.
Modified: trunk/sandy/as2/branches/2_0/tests/spriteTest/src/SpriteTest.as
==============================================================================
--- trunk/sandy/as2/branches/2_0/tests/spriteTest/src/SpriteTest.as (original)
+++ trunk/sandy/as2/branches/2_0/tests/spriteTest/src/SpriteTest.as Wed Apr 25 \
00:40:18 2007 @@ -73,27 +73,21 @@
{
// -- variables declaration
var g:Group = new Group();
- var tgTranslation:TransformGroup = new TransformGroup("translation");
- // -- transformations
- tgTranslation.z = 500;
// -- creation of the materials and apperance
var b:BitmapData = BitmapUtil.movieToBitmap( \
GraphicLibLocator.getInstance().getGraphicLib("TEXTURE").getContent(), false ); var \
l_oTextureAppearance:Appearance = new Appearance( new BitmapMaterial( b ) ); // --
- var l_oMaterial:Material = new ColorMaterial( 0xFF0000, 100 );
- l_oMaterial.lineAttributes = new LineAttributes( 10, 0xFF, 100 );
- var l_oAppearance:Appearance = new Appearance( l_oMaterial );
- // --
- var l_oSprite:Sprite2D = new Sprite2D();
- l_oSprite.appearance = l_oTextureAppearance;
-
- var l_oSprite2:Sprite2D = new Sprite2D();
- l_oSprite2.x = -100;
- l_oSprite2.appearance = l_oAppearance;
- // --
- tgTranslation.addChild( l_oSprite );
- tgTranslation.addChild( l_oSprite2 );
- g.addChild( tgTranslation );
+ var l:Number = 100;
+ var slice:Number = Math.PI * 2 / l;
+ while( --l > -1 )
+ {
+ var l_oSprite:Sprite2D = new Sprite2D("sprite_"+l);
+ l_oSprite.x = 1000 * Math.cos( l*slice );
+ l_oSprite.z = 1000 * Math.sin( l*slice );
+ l_oSprite.appearance = l_oTextureAppearance;
+ // --
+ g.addChild( l_oSprite );
+ }
// --
return g;
}
@@ -105,8 +99,8 @@
// --
//if(Key.isDown(Key.HOME)) cam.moveForward(1);
//if(Key.isDown(Key.END)) cam.moveForward(-5);
- if ( Key.isDown(Key.UP)) cam.moveForward(3);
- if ( Key.isDown(Key.DOWN)) cam.moveForward(-3);
+ if ( Key.isDown(Key.UP)) cam.moveForward(5);
+ if ( Key.isDown(Key.DOWN)) cam.moveForward(-5);
if(Key.isDown(Key.LEFT)) cam.rotateY += 1;
if(Key.isDown(Key.RIGHT)) cam.rotateY -= 1;
// --
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic