Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it L'avatar di goat
    Registrato dal
    Apr 2003
    Messaggi
    1,154

    Creare VR a meno di 360°...

    Ciao ciao, usando il seguente codice ottengo l'effetto VR a 360°; mi trovo però a dover creare alcuni VR che non vanno oltre i 180°, tornerebbe quindi utile che il VR partisse dal grado 0 e permettesse la rotazione fino al grado X. Troppo complicato modificare il codice del 360°? Resto in attesa d'illuminazioni...
    Grazie.

    onClipEvent (load) {
    lVX = this._x;
    lVY = this._y;
    pP = true;
    ce = _root.cornice._x;
    h = this._height;
    bl = false;
    }
    onClipEvent (mouseDown) {
    dr = true;
    }
    onClipEvent (mouseUp) {
    dr = false;
    pP = true;
    _root.c1.removeMovieClip();
    _root.c2.removeMovieClip();
    _root.riga._visible = false;
    c = 0;
    bl = false;
    }
    onClipEvent (enterFrame) {
    cnt = this.getBounds(_root);
    mL = this._width/2;
    pV = cnt["xMin"]+mL;
    ceD = ce-pV;
    pD = ceD/mL*100;
    if (_root._xmouse>_root.cntC["xMin"] and _root._xmouse<_root.cntC["xMax"] and _root._ymouse<_root.cntC["yMax"] and _root._ymouse>_root.cntC["yMin"] and dr) {
    if (pP) {
    _root.riga._visible = false;
    _root.cerchietto.duplicateMovieClip("c1", 1);
    _root.cerchietto.duplicateMovieClip("c2", 2);
    _root.riga._x = _root._xmouse;
    _root.riga._y = _root._ymouse;
    pMA = _root._xmouse;
    pMAY = _root._ymouse;
    _root.c1._x = _root._xmouse;
    _root.c1._y = _root._ymouse;
    pMB = pMA;
    pP = false;
    } else {
    pMB = _root._xmouse;
    pMBY = _root._ymouse;
    }
    c++;
    if (c>1) {
    _root.riga._visible = true;
    }
    _root.c2._x = _root._xmouse;
    _root.c2._y = _root._ymouse;
    dstY = _root.c1._y-_root.c2._y;
    dst = pMB-pMA;
    distY = pMBY-pMAY;
    _root.riga._xscale = dst;
    _root.riga._yscale = distY;
    this._x -= dst/_root.rX;
    if (cnt["yMin"]<_root.cntC["yMin"] and cnt["yMax"]>_root.cntC["yMax"] and !bl) {
    this._y += dstY/_root.rY;
    }
    if (this._x<lVX-this._width/3 or this._x>lVX+this._width/3) {
    this._x = lVX;
    }
    if (cnt["yMin"]>=_root.cntC["yMin"]) {
    bl = true;
    this._y--;
    }
    if (cnt["yMax"]<=_root.cntC["yMax"]) {
    bl = true;
    this._y++;
    }
    }
    }
    "Qualunque impressione faccia su di noi, egli è un servo della legge, quindi appartiene alla legge e sfugge al giudizio umano."

  2. #2
    Utente di HTML.it L'avatar di goat
    Registrato dal
    Apr 2003
    Messaggi
    1,154
    Aggiornamento; un nerd di passaggio mi ha suggerito questo come bandolo della matassa:

    onClipEvent(load){
    _root.cntC=this.getBounds(_root);
    }
    "Qualunque impressione faccia su di noi, egli è un servo della legge, quindi appartiene alla legge e sfugge al giudizio umano."

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.