Skip to content

Commit

Permalink
tidied spritesheetanimation example, added signature
Browse files Browse the repository at this point in the history
  • Loading branch information
rob-bateman committed May 6, 2013
1 parent b7a588e commit e1b63ec
Show file tree
Hide file tree
Showing 25 changed files with 35 additions and 23 deletions.
Binary file removed embeds/spritesheets/models/tictac/tictac.awd
Binary file not shown.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
4 changes: 2 additions & 2 deletions src/Intermediate_Head.as
Expand Up @@ -202,8 +202,8 @@ package
//create subscattering diffuse method
subsurfaceMethod = new SubsurfaceScatteringDiffuseMethod(2048, 2);
subsurfaceMethod.scatterColor = 0xff7733;
subsurfaceMethod.scattering = .05;
subsurfaceMethod.translucency = 4;
subsurfaceMethod.scattering = 50;
subsurfaceMethod.translucency = 0.001;
headMaterial.diffuseMethod = subsurfaceMethod;

//create fresnel specular method
Expand Down
6 changes: 3 additions & 3 deletions src/Intermediate_OnkbaAWDAnimation.as
Expand Up @@ -73,7 +73,7 @@ package
import flash.net.*;
import flash.text.*;
import flash.ui.*;
import utils.*;


Expand Down Expand Up @@ -783,7 +783,7 @@ package
// materials
_eyesClosedMaterial = new ColorMaterial(0xA13D1E);
_eyesClosedMaterial.lightPicker = _lightPicker;
_eyesClosedMaterial.shadowMethod = new TripleFilteredShadowMapMethod(DirectionalLight(_sunLight));
_eyesClosedMaterial.shadowMethod = new SoftShadowMapMethod(DirectionalLight(_sunLight), 20);
_eyesClosedMaterial.gloss = 12;
_eyesClosedMaterial.specular = 0.6;
_eyesClosedMaterial.ambient = 1;
Expand All @@ -794,7 +794,7 @@ package
_eyesOpenMaterial = new TextureMaterial(Cast.bitmapTexture(b));
_eyesOpenMaterial.lightPicker = _lightPicker;
_eyesOpenMaterial.addMethod(new EnvMapMethod(_skyMap, 0.1));
_eyesOpenMaterial.shadowMethod = new TripleFilteredShadowMapMethod(DirectionalLight(_sunLight));
_eyesOpenMaterial.shadowMethod = new SoftShadowMapMethod(DirectionalLight(_sunLight), 20);
_eyesOpenMaterial.gloss = 300;
_eyesOpenMaterial.specular = 5;
_eyesOpenMaterial.ambient = 1;
Expand Down
48 changes: 30 additions & 18 deletions src/Intermediate_SpriteSheetAnimation.as
Expand Up @@ -79,32 +79,37 @@ package {

public class Intermediate_SpriteSheetAnimation extends Sprite
{
//signature swf
[Embed(source="/../embeds/signature.swf", symbol="Signature")]
public var SignatureSwf:Class;

//the swf file holding timeline animations
[Embed(source="../embeds/spritesheets/digits.swf", mimeType="application/octet-stream")]
[Embed(source="/../embeds/spritesheets/digits.swf", mimeType="application/octet-stream")]
private var SourceSWF : Class;

[Embed(source="../embeds/spritesheets/models/tictac/textures/furniture_NM.png")]
public static var WoodNormal:Class;

[Embed(source="../embeds/spritesheets/models/tictac/textures/back_CB0.jpg")]

[Embed(source="/../embeds/spritesheets/textures/back_CB0.jpg")]
private var Back_CB0_Bitmap:Class;
[Embed(source="../embeds/spritesheets/models/tictac/textures/back_CB1.jpg")]
[Embed(source="/../embeds/spritesheets/textures/back_CB1.jpg")]
private var Back_CB1_Bitmap:Class;
[Embed(source="../embeds/spritesheets/models/tictac/textures/back_CB2.jpg")]
[Embed(source="/../embeds/spritesheets/textures/back_CB2.jpg")]
private var Back_CB2_Bitmap:Class;
[Embed(source="../embeds/spritesheets/models/tictac/textures/back_CB3.jpg")]
[Embed(source="/../embeds/spritesheets/textures/back_CB3.jpg")]
private var Back_CB3_Bitmap:Class;
[Embed(source="../embeds/spritesheets/models/tictac/textures/back_CB4.jpg")]
[Embed(source="/../embeds/spritesheets/textures/back_CB4.jpg")]
private var Back_CB4_Bitmap:Class;
[Embed(source="../embeds/spritesheets/models/tictac/textures/back_CB5.jpg")]
[Embed(source="/../embeds/spritesheets/textures/back_CB5.jpg")]
private var Back_CB5_Bitmap:Class;

//engine variables
private var _view:View3D;
private var _loader:Loader3D;
private var _origin:Vector3D;
private var _staticLightPicker:StaticLightPicker;


//signature variables
private var Signature:Sprite;
private var SignatureBitmap:Bitmap;

//demo variables
private var _hoursDigits:SpriteSheetMaterial;
private var _minutesDigits:SpriteSheetMaterial;
Expand Down Expand Up @@ -148,6 +153,7 @@ package {
{
//setup the view
_view = new View3D();
_view.addSourceURL("srcview/index.html");
addChild(_view);

_view.antiAlias = 2;
Expand All @@ -159,9 +165,17 @@ package {
_view.camera.x = -17850;
_view.camera.y = 12390;
_view.camera.z = -9322;

//saving the origin, as we look at it on enterframe
_origin = new Vector3D();

//add signature
Signature = Sprite(new SignatureSwf());
SignatureBitmap = new Bitmap(new BitmapData(Signature.width, Signature.height, true, 0));
stage.quality = StageQuality.HIGH;
SignatureBitmap.bitmapData.draw(Signature);
stage.quality = StageQuality.LOW;
addChild(SignatureBitmap);
}

/**
Expand Down Expand Up @@ -304,7 +318,7 @@ package {
_loader.addEventListener(LoaderEvent.RESOURCE_COMPLETE, onLoadedComplete);
_loader.addEventListener(LoaderEvent.LOAD_ERROR, onLoadedError);
//the url must be relative to swf once published, change the url for your setup accordingly.
_loader.load(new URLRequest("../embeds/spritesheets/models/tictac/tictac.awd"), null, null, new AWD2Parser());
_loader.load(new URLRequest("assets/tictac/tictac.awd"), null, null, new AWD2Parser());
}

private function onLoadedError(event:LoaderEvent):void
Expand Down Expand Up @@ -354,10 +368,6 @@ package {


case "furniture":
//
//var map:BitmapData = Bitmap(new WoodNormal()).bitmapData;
//var bt:BitmapTexture = new BitmapTexture(map);
//TextureMaterial(mesh.material).normalMap = bt;
mesh.material.lightPicker = _staticLightPicker;
break;

Expand Down Expand Up @@ -465,6 +475,8 @@ package {
{
_view.width = stage.stageWidth;
_view.height = stage.stageHeight;

SignatureBitmap.y = stage.stageHeight - Signature.height;
}
}
}
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes

0 comments on commit e1b63ec

Please sign in to comment.