[ascoders] Re: AW: Re: Rotation nach Mausposition *gedämpft*

Wie wäre es so:

this.pointer.onEnterFrame=function() {
var r=Math.atan2(this._parent._ymouse-this._y, this._parent._xmouse-this._x)/Math.PI*180;
if ((r+360)-this._rotation < Math.abs(r-this._rotation)) r+=360;
this._rotation = 0.8*this._rotation+0.2*r
}


Gruß Mario

----- Original Message ----- From: "Timo Hölzer" <t.hoelzer@xxxxxxxxx>
To: <ascoders@xxxxxxxxxxxxx>
Sent: Wednesday, October 13, 2004 10:40 PM
Subject: [ascoders] AW: Re: Rotation nach Mausposition *gedämpft*



Hi André

Danke erstmal für Deien Hilfe...

So soll's sein, allerdings ohne den Fehler auf 9 Uhr
---------------------------------------------------------------
onClipEvent(enterFrame) {
this.r  = Math.atan2(this._parent._ymouse-this._y,
this._parent._xmouse-this._x)/Math.PI*180;

this.rpos = (this.rpos*0.8)+((this.r-this._rotation)*0.2);

this._rotation += this.rpos

}
---------------------------------------------------------------


Mit deinem Code zuckt der Clip nur vor sich hin --------------------------------------------------------------- onClipEvent(enterFrame) { this.r = Math.atan2(this._parent._ymouse-this._y, this._parent._xmouse-this._x)/Math.PI*180;

this.rpos = (this.rpos*0.6)+((this.r-this._rotation)*0.2);

while( this.rpos > Math.PI ) this.rpos -= Math.PI*2;
while( this.rpos <-Math.PI ) this.rpos += Math.PI*2;

this._rotation += this.rpos

}
---------------------------------------------------------------

Ich hab schon ziemlich viel probiert, aber ich komm
irgendwie nicht dahinter :(

Timo


-----Ursprüngliche Nachricht----- Von: ascoders-bounce@xxxxxxxxxxxxx [mailto:ascoders-bounce@xxxxxxxxxxxxx]Im Auftrag von André Michelle Gesendet: Mittwoch, 13. Oktober 2004 21:36 An: ascoders@xxxxxxxxxxxxx Betreff: [ascoders] Re: Rotation nach Mausposition *gedämpft*


probier mal:

this.rpos = (this.rpos*0.6)+((r-this._rotation)*0.2);
while( this.rpos > Math.PI ) this.rpos -= Math.PI*2;
while( this.rpos <-Math.PI ) this.rpos += Math.PI*2;
this._rotation += this.rpos

--
aM

------------------------------------------------------
Archiv   : http://www.freelists.org/archives/ascoders/
Optionen : http://www.freelists.org/list/ascoders
------------------------------------------------------

------------------------------------------------------
Archiv   : http://www.freelists.org/archives/ascoders/
Optionen : http://www.freelists.org/list/ascoders
------------------------------------------------------


------------------------------------------------------ Archiv : http://www.freelists.org/archives/ascoders/ Optionen : http://www.freelists.org/list/ascoders ------------------------------------------------------

Other related posts: