Flash 3D

Yasso1986 Messages postés 4 Date d'inscription mercredi 1 août 2007 Statut Membre Dernière intervention 22 janvier 2009 - 22 janv. 2009 à 11:09
harrath Messages postés 3 Date d'inscription dimanche 25 février 2007 Statut Membre Dernière intervention 6 février 2009 - 3 févr. 2009 à 22:26
existe _il une foction pour calculer le perimetre

5 réponses

Yasso1986 Messages postés 4 Date d'inscription mercredi 1 août 2007 Statut Membre Dernière intervention 22 janvier 2009
22 janv. 2009 à 11:11
il ya
0
faiblard Messages postés 337 Date d'inscription samedi 3 février 2007 Statut Membre Dernière intervention 4 janvier 2011
22 janv. 2009 à 11:23
Bonjour?
Au revoir :D
0
cs_Burnside Messages postés 1132 Date d'inscription mercredi 28 août 2002 Statut Membre Dernière intervention 6 mars 2020
22 janv. 2009 à 11:56
J'adore ce genre de type...
Je sais pas comment faire - je pose ma question puis je cherche un peu et je trouve ensuite je repond à moi même sans mettre de solution pour le prochain dans son genre qui passera...

Bàt,
Burnside.

..:: Enjoy living in hell ::..
http://www.art-line.be
0
cs_bali_balo Messages postés 1378 Date d'inscription samedi 9 octobre 2004 Statut Membre Dernière intervention 1 novembre 2010 1
22 janv. 2009 à 16:28
C'est clair... Surtout qu'on ne sait le périmètre de quoi il veut calculer et comment il a fait.
Désolé si je passe la majeur partie de mon temps à critiquer les "posteurs" que de leur répondre...
bali_balo....=]
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
harrath Messages postés 3 Date d'inscription dimanche 25 février 2007 Statut Membre Dernière intervention 6 février 2009
3 févr. 2009 à 22:26
Salut à tous
J'ai trouvé une animation flash dans un site web qui est sous la forme d'une présentation de 5 photos dans un environnement 3D mais cette animation pour fonctionner elle charge des parametres du site d'origine .SVP aidez moi pour changer le scipt de l'animation pour quelle charge des image de ma disque dur.
Meri
le script est "

// Action script...


// [Action in Frame 1]
function disparaitre()
{
    this._alpha = this._alpha - 0.200000 * this._alpha;
    if (this._alpha < 2)
    {
        this.removeMovieClip();
    } // end if
} // End of the function
function interpolation()
{
    somme = 0;
    var _l2 = matriceEnd.a - matriceStart.a;
    matriceStart.a = matriceStart.a + coefficient * _l2;
    somme = somme + Math.abs(_l2);
    _l2 = matriceEnd.b - matriceStart.b;
    matriceStart.b = matriceStart.b + coefficient * _l2;
    somme = somme + Math.abs(_l2);
    _l2 = matriceEnd.c - matriceStart.c;
    matriceStart.c = matriceStart.c + coefficient * _l2;
    somme = somme + Math.abs(_l2);
    _l2 = matriceEnd.d - matriceStart.d;
    matriceStart.d = matriceStart.d + coefficient * _l2;
    somme = somme + Math.abs(_l2);
    _l2 = matriceEnd.tx - matriceStart.tx;
    matriceStart.tx = matriceStart.tx + coefficient * _l2;
    somme = somme + Math.abs(_l2);
    _l2 = matriceEnd.ty - matriceStart.ty;
    matriceStart.ty = matriceStart.ty + coefficient * _l2;
    somme = somme + Math.abs(_l2);
    _root.clip["face" + numFace].transform.matrix = matriceStart;
} // End of the function
function interpolationAvecStop()
{
    interpolation();
    if (somme < 1)
    {
        var _l2 = 0;
        while (_l2 < nbr)
        {
            clip["face" + _l2].enabled = true;
            ++_l2;
        } // end while
        numFace = -1;
        _root.onEnterFrame = faireTourner;
    } // end if
} // End of the function
function newPoint3D(x, y, z)
{
    var _l1 = new Object();
    _l1.x = x;
    _l1.y = y;
    _l1.z = z;
    return (_l1);
} // End of the function
function faireTourner()
{
    rotationx = rotationx + 0.040000 * (_xmouse - x0) / 200;
    rotationy = rotationy + 0.040000 * (_ymouse - y0) / 200;
    if (rotationy > rotationyMax)
    {
        rotationy = rotationyMax;
    }
    else if (rotationy < rotationyMin)
    {
        rotationy = rotationyMin;
    } // end if
    var _l11 = Math.cos(rotationx);
    var _l9 = Math.cos(rotationy);
    var _l10 = Math.sin(rotationx);
    var _l8 = Math.sin(rotationy);
    points3DR = new Array();
    points2D = new Array();
    var _l1 = 0;
    while (_l1 < 3 * nbr)
    {
        var _l14 = _l11 * points3D[_l1].x - _l10 * points3D[_l1].y;
        var _l13 = _l10 * points3D[_l1].x + _l11 * points3D[_l1].y;
        var _l12 = points3D[_l1].z;
        var _l4 = _l14;
        var _l3 = _l9 * _l13 - _l8 * _l12;
        var _l6 = _l8 * _l13 + _l9 * _l12;
        points3DR[_l1] = {x: _l4, y: _l3, z: _l6};
        points2D[_l1] = {x: _l4, y: _l3};
        ++_l1;
    } // end while
    _l1 = 0;
    while (_l1 < nbr)
    {
        var _l2 = clip["face" + _l1];
        matrices[_l1].a = (points2D[3 * _l1 + 1].x - points2D[3 * _l1].x) / largeur;
        matrices[_l1].b = (points2D[3 * _l1 + 1].y - points2D[3 * _l1].y) / largeur;
        matrices[_l1].c = (points2D[3 * _l1 + 2].x - points2D[3 * _l1].x) / hauteur;
        matrices[_l1].d = (points2D[3 * _l1 + 2].y - points2D[3 * _l1].y) / hauteur;
        matrices[_l1].tx = points2D[3 * _l1].x;
        matrices[_l1].ty = points2D[3 * _l1].y;
        _l2.transform.matrix = matrices[_l1];
        var _l7 = (points3DR[3 * _l1 + 1].z + points3DR[3 * _l1 + 2].z) * 1;
        _l2.swapDepths(_l7);
        var _l5 = faceVisible(points3DR[3 * _l1], points3DR[3 * _l1 + 1], points3DR[3 * _l1 + 2]);
        _l2.conteneur._alpha = _l5;        _l2.useHandCursor _l5 100 ? (true) : (false);
        ++_l1;
    } // end while
} // End of the function
nbr = 5;
largeurPhysique = 600;
hauteurPhysique = 400;
prc = 0.200000;
largeur = largeurPhysique * prc;
hauteur = hauteurPhysique * prc;
largeur2 = 0.800000 * largeur;
hauteur2 = 0.020000 * hauteur;
dl = 0.500000 * largeur;
dh = 0.500000 * hauteur;
rayon = (dl + 10) / Math.tan(3.141593 / nbr);
x0 = 300;
y0 = 200;
matrices = new Array();
matriceStart;
(matriceEnd = new flash.geom.Matrix());
coefficient1 = 0.250000;
coefficient2 = 0.400000;
coefficient = 0;
somme = 0;
numClic = 0;
numFace = -1;
MovieClip.prototype.tracerRectangle = function (w, h, c0, c1, a0, a1)
{
    this.clear();
    this.lineStyle(0, c0, a0);
    this.beginFill(c1, a1);
    this.moveTo(0, 0);
    this.lineTo(w, 0);
    this.lineTo(w, h);
    this.lineTo(0, h);
    this.lineTo(0, 0);
    this.endFill();
};
points3D = new Array();
var i = 0;
while (i < nbr)
{
    var angle = 6.283185 / nbr * i;
    var ca = Math.cos(angle);
    var sa = Math.sin(angle);
    points3D[3 * i] = newPoint3D(rayon * ca - dl * sa, rayon * sa + dl * ca, dh);
    points3D[3 * i + 1] = newPoint3D(rayon * ca + dl * sa, rayon * sa - dl * ca, dh);
    points3D[3 * i + 2] = newPoint3D(rayon * ca - dl * sa, rayon * sa + dl * ca, -dh);
    ++i;
} // end while
this.createEmptyMovieClip("clip", 0);
clip._x = x0;
clip._y = y0;
faceVisible = function (p0, p1, p2)
{
    var _l8 = p1.x - p0.x;
    var _l6 = p1.y - p0.y;
    var _l10 = p1.z - p0.z;
    var _l7 = p2.x - p0.x;
    var _l4 = p2.y - p0.y;
    var _l9 = p2.z - p0.z;
    var _l2 = _l8 * _l4 - _l6 * _l7;
    return (_l2 > 0 ? (100) : (10));
};
var i = 0;
while (i < nbr)
{
    matrices[i] = new flash.geom.Matrix();
    var facemc = clip.createEmptyMovieClip("face" + i, i);
    facemc.i = i;
    var verso = facemc.createEmptyMovieClip("verso", 0);
    verso.tracerRectangle(largeur, hauteur, "0x000000", "0xFFFFFF", 10, 100);
    var loader = facemc.createEmptyMovieClip("loader", 3);
    loader._y = 0.500000 * (hauteur - hauteur2);
    var conteneur = facemc.createEmptyMovieClip("conteneur", 1);
    var mcl = new MovieClipLoader();
    var ecouteur = new Object();
    ecouteur.mcl = mcl;
    ecouteur.conteneur = conteneur;
    ecouteur.loader = loader;
    ecouteur.i = i;
    mcl.addListener(ecouteur);
    ecouteur.onLoadProgress = function ()
    {
        var _l3 = this.mcl.getProgress(this.conteneur);
        var _l2 = _l3.bytesLoaded / _l3.bytesTotal;
        this.loader.tracerRectangle(largeur2 * _l2, hauteur2, "0x000000", "0xCCCCCC", 0, 100);
        this.loader._x = 0.500000 * (largeur - largeur2 * _l2);
    };
    ecouteur.onLoadComplete = function ()
    {
        this.loader.tracerRectangle(largeur, hauteur, "0x000000", "0xFFFFFF", 0, 100);
        this.loader.onEnterFrame = disparaitre;
        _root.clip["face" + this.i].onPress = function ()
        {
            if (this.conteneur._alpha == 100)
            {
                var _l3 = 0;
                while (_l3 < nbr)
                {
                    if (_l3 != this.i)
                    {
                        _root.clip["face" + _l3].enabled = false;
                    } // end if
                    ++_l3;
                } // end while
                numFace = this.i;
                ++numClic;
                numClic = numClic % 2;
                var _l4 = _root.clip.getNextHighestDepth();
                this.swapDepths(_l4);
                if (numClic == 1)
                {
                    coefficient = coefficient1;
                    matriceStart = this.transform.matrix.clone();
                    matriceEnd.identity();
                    matriceEnd.scale(1 / prc, 1 / prc);
                    matriceEnd.translate(-x0, -y0);
                    _root.onEnterFrame = interpolation;
                }
                else
                {
                    matriceStart = this.transform.matrix.clone();
                    matriceEnd = matrices[this.i].clone();
                    coefficient = coefficient2;
                    _root.onEnterFrame = interpolationAvecStop;
                } // end if
            } // end if
        };
    };    conteneur._xscale conteneur._yscale 100 * prc;
    mcl.loadClip("http://www.zoneflash.net/flash/0183_fichiers/gromit" + i + ".jpg", conteneur);
    ++i;
} // end while
rotationx = 0;
rotationy = 1.570796;
amplitude = 0.785398;
rotationyMax = rotationy + amplitude;
rotationyMin = rotationy - amplitude;
clip.cacheAsBitmap = true;
_root.onEnterFrame = faireTourner;
"
0
Rejoignez-nous