Visualizzazione dei risultati da 1 a 4 su 4

Discussione: [A2S]3D carousel

  1. #1
    Utente di HTML.it
    Registrato dal
    May 2002
    Messaggi
    1,037

    [A2S]3D carousel

    CIAO ,
    Ho un problema con il questa funzione di calcolo, nell senso se imposto centerY e centerX funziona perfettamente, pero se entrambi imposto a 0, perde l'effetto 3d.

    Sequalcuno sa come posso modificare questa prte dell codice
    var s = (this._y - perspective)/ ( centerY+ radiusY-perspective);
    this._xscale = this._yscale = s*100;


    codice:
    var radiusX:Number = 300;
    var radiusY:Number = 100;
    var centerX:Number = 200;
    var centerY:Number = 100;
    var speed:Number = -0.2;
    var perspective:Number = 20;
    
    
    function mover()
    {
    	this._x = Math.cos(this.angle) * radiusX + centerX;
    	this._y = Math.sin(this.angle) * radiusY + centerY;
    	var s = (this._y -  perspective)/ ( centerY+ radiusY-perspective);
    	this._xscale = this._yscale = s*100;
    	this.angle += speed;
    	this.swapDepths(Math.round(this._xscale) + 100);
    }
    grazie in anticipo

  2. #2
    direi che potresti immaginare una ellisse che si sviluppa in orizzontale

    il cui centro è in x=200, y=100

    il diametro orizzontale è 300 quello verticale è 100 ed ha una schiacciatura nell senso verticale di 20


    se imposti le coordinate in 0,0 dovresti perdere 3/4 dell'ellisse

    che valore ti viene facendo una trace di

    Math.cos(this.angle) * radiusX ??

  3. #3
    Utente di HTML.it
    Registrato dal
    May 2002
    Messaggi
    1,037
    purtroppo non funziona :-(

  4. #4
    Utente di HTML.it
    Registrato dal
    May 2002
    Messaggi
    1,037
    Ciao,
    Vorrei poter ruotare a destra e a sinistra con i bottoni, e non con evento mouseover ,come segue.
    codice:
    original
    this.onMouseMove = function()
    {
    	speed = (this._xmouse-centerX)/2500;
    }
    
    
    quanto deve aver il valore range tenendo conte che num items puo cambiare sempre al caricamento del filmato?
    con questo calcolo non funziona :-(
    var range:Number =((Math.PI * 2) / numOfItems)/numOfItems
    function mov()
    {
    	var attRange= range
    	this.onEnterFrame = function()
    	{
    		speed = attRange-= .001;
    		trace(speed)
    		if (speed <= 0) {
    			speed= 0
    			this.onEnterFrame = null;
    		}
    	};
    }

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.