Here's the code from mine...
Code:
_global.gfxExtensions = true;
var brot:Boolean = false;
var ox:Number = 0;
var oy:Number = 0;
var orx:Number = 0;
var ory:Number = 0;
this.onMouseMove = function() {
if (brot) {
calcRotations();
}
}
var mouseListener:Object = new Object;
Mouse.addListener(mouseListener);
mouseListener.onMouseDown = function(button : Number) {
if (button == 2) {
brot = true;
ox = _root._xmouse;
oy = _root._ymouse;
orx = Hud._yrotation;
ory = -Hud._xrotation;
}
}
mouseListener.onMouseUp = function(button : Number) {
if (button == 2) {
brot = false;
}
}
function calcRotations():Void {
rotX = orx + ((_root._xmouse - ox) / 1024) * 90;
rotY = ory + ((_root._ymouse - oy) / 1024) * 90;
Hud._yrotation = rotX;
Hud._xrotation = -rotY;
Left._yrotation = rotX
Left._xrotation = -rotY
Right._yrotation = rotX
Right._xrotation = -rotY
}
Note: HUD,Left,and Right are the Movie Clips on my 3Di interface, replace them with your corresponding Movie Clip instance names.
Bookmarks