Return to Snippet

Revision: 12840
at March 30, 2009 14:46 by allnatural


Initial Code
var ShiftY: Number = stage.stageWidth / 2;
var ShiftX: Number = stage.stageHeight / 2;

// number @ the end (90) is the degree's to allow object to turn
var rotationY: Number = -( (mouseX - ShiftY) / stage.stageWidth * 90);
var rotationX: Number = -( (mouseY - ShiftX) / stage.stageHeight * 90);

// Replace _screenCube with the object you wish to control	
// Lower number = faster turns
_screenCube.rotationY += (-rotationY - _screenCube.rotationY) / 12; 
_screenCube.rotationX += (rotationX - _screenCube.rotationX) / 12;

Initial URL
http://www.destroyyourcomputer.com

Initial Description
Control your objects via mouse similar to AirtightInteractive's TiltViewer

Initial Title
Papervision3D - TiltViewer Style Mouse Interactions

Initial Tags

                                

Initial Language
ActionScript 3