Pagina 1 di 3 1 2 3 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 22

Discussione: logo rotante

  1. #1

    logo rotante

    Ciao raga,
    ho bisogno di voi per andare avanti.
    Ho un menu con i pulsanti tutt'intorno al logo. Vorrei che il logo ruotasse in base alla posizione del mouse. Come faccio?

    Cià e grazie.
    Ang
    non si finisce mai di sperare...

  2. #2
    Utente di HTML.it L'avatar di negatyve
    Registrato dal
    Feb 2001
    Messaggi
    9,479
    Hai già l'animazione base del logo che ruota?

  3. #3
    ho un'animazione del logo che ruota creata su due keyframe incrementando la var i se non raggiunge 360.
    non si finisce mai di sperare...

  4. #4
    Utente di HTML.it L'avatar di negatyve
    Registrato dal
    Feb 2001
    Messaggi
    9,479
    aspetta, ruota come la ruota di una macchina (scusa il gioco di parole)?

  5. #5
    ruota su se stesso.
    Poi ha una freccia che fa da puntatore
    non si finisce mai di sperare...

  6. #6
    Utente di HTML.it L'avatar di negatyve
    Registrato dal
    Feb 2001
    Messaggi
    9,479
    E come vuoi che ruoti, rispetto al mouse?

  7. #7
    Vorrei che la freccia-puntatore ruotasse nella direzione dove si trova il mouse rimanendo ancorato al suo centro e al centro del filmato.
    non so se... sono stata spiegata...:master:
    non si finisce mai di sperare...

  8. #8
    ruota_mc e' un movieClip con punto di registrazione al centro ....

    scusa se non e' perfetta ma coi semiquadri e la geometria ho cominciato da poco.

    ti dico il bug:
    se vai da piu' di 270° a meno di 270 [ lo 0 e' la x0 e y0 dello stage ] fa il giro dall' altra parte ... altrimenti e' OK [ quindi orario OK, antiorario OK tranne a 270 ]

    .... se riesci a perfezionarlo fammelo sapere


    Codice PHP:
    ruota_mc.onEnterFrame = function() {
        var 
    _root._xmouse;
        var 
    _root._ymouse;
        if(
    x<Stage.width/&& y<Stage.height/2) {
            var 
    x_rot = (( 180 ) / Stage.width);
            var 
    y_rot = -(( 180 ) / Stage.height);
            var 
    ruota = ((y_rot/2)+(x_rot/2));
        }
        else if(
    x>Stage.width/&& y<Stage.height/2) {
            var 
    x_rot = (( 180 ) / Stage.width);
            var 
    y_rot = (( 180 ) / Stage.height);
            var 
    ruota = ((y_rot/2)+(x_rot/2));    
        }
        else if(
    x>Stage.width/&& y>Stage.height/2) {
            var 
    x_rot = -(( 180 ) / Stage.width);
            var 
    y_rot = (( 180 ) / Stage.height);
            var 
    ruota 180 + ((y_rot/2)+(x_rot/2));    
        }
        else {
            var 
    x_rot = -(( 180 ) / Stage.width);
            var 
    y_rot = -(( 180 ) / Stage.height);
            var 
    ruota = ((y_rot/2)+(x_rot/2));
        }
        if(    
    ruota 180 ) {
            
    this._rotation += ( ruota this._rotation ) / 10;
        }
        else {
            
    this._rotation += ( ruota 360 this._rotation ) / 10;
        }

    Formaldehyde a new Ajax PHP Zero Config Error Debugger

    WebReflection @WebReflection

  9. #9
    Utente di HTML.it L'avatar di negatyve
    Registrato dal
    Feb 2001
    Messaggi
    9,479

    oppure:

    Flash5:

    associ al movieclip del logo:

    codice:
    onClipEvent(mouseMove){
    	var x = Math.round(_root._xmouse - this._x);
    	var y = Math.round(_root._ymouse - this._y);
    	var z = Math.atan(y / x) * (180 / Math.PI);
    	this._rotation = x < 0 ? Math.round(180 + z) : z;
    	updateAfterEvent();
    }

    Flash MX:


    scrivi nello stesso frame del logo:

    codice:
    this.logo.onMouseMove = function()
    {
    	var x = Math.round(_root._xmouse - this._x);
    	var y = Math.round(_root._ymouse - this._y);
    	var z = Math.atan(y / x) * (180 / Math.PI);
    	this._rotation = x < 0 ? Math.round(180 + z) : z;
    	updateAfterEvent();
    }

  10. #10

    Re: oppure:

    Originariamente inviato da negatyve
    var z = Math.atan(y / x) * (180 / Math.PI);
    ... esattamente quello che mi mancava ... lo dicevo io ke ero fagiano in geometria ...


    updateAfterEvent(); <-- questa ??? :master:
    Formaldehyde a new Ajax PHP Zero Config Error Debugger

    WebReflection @WebReflection

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.