Utilizator:
Parola:
Am uitat parola... | Cont nou!


Articole Resurse Echipe Competiții Proiecte Forum DevBlogs Locuri de muncă GDROMag Issue#1 GDROCon 2007

 
Forum » Programare » Matematică » Camera




Pagina 2 din 2 [ 1 | 2 ]

Mesaj Info autor
    Postat la 20 Sep 2007 21:21:24    Subiect: < fara subiect >
Pintea info:

Pintea:

of, nu exista cele 3 inmultiri, ce tot tineti sa ma contraziceti ?

Si nu era vorba de performanta, ca daca ar fi as putea adauga ca rotatiile astea nu se aplica doar la camera, ci de zeci/sute de ori per frame intr-un joc serios, iar daca vrei performanta ai putea sa aplici metode rapide ptr sin/cos ca sa mai scoti ceva, dar banuiesc ca de aia merg motoarele astea free asa "bine", ca "nu conteaza".



Status:
Înregistrat pe:
05 May 2007 14:50:45
Vârsta: 29 ani
Mesaje: 301
Locatie:
Programator

 
    Postat la 20 Sep 2007 21:23:08    Subiect: < fara subiect >
Pintea info:

Pintea:

cu dedicatie:
Cod sursă:

void Matrix::ToRotation(const float degrees[3])
{
    float angle;
    float sx, sy, sz, cx, cy, cz;

    angle = Math::DegToRadians( degrees[1] );
    sx = sinf(angle);
    cx = cosf(angle);
    angle = Math::DegToRadians( degrees[0] );
    sy = sinf(angle);
    cy = cosf(angle);

    if ( degrees[2] )
    {
        angle = Math::DegToRadians( degrees[2] );
        sz = sinf(angle);
        cz = cosf(angle);
    }
    else
    {
        sz = 0;
        cz = 1;
    }

    _11 = cy * cz ;
    _21 =-cy * sz ;
    _31 = sy ;
    _41 = 0;

    _12 = sx * sy * cz - cx * sz ;
    _22 = sx * sy * sz + cx * cz ;
    _32 =-sx * cy ;
    _42 = 0;

    _13 =-cx * sy * cz + sx * sz ;
    _23 = cx * sy * sz + sx * cz ;
    _33 = cx * cy ;
    _43 = 0;

    _14 = _24 = _34 = 0;
    _44 = 1;
}
 

Ultima editare efectuată de nekitu pe 06 Oct 2007 18:32:00; 1 editări în total



Status:
Înregistrat pe:
05 May 2007 14:50:45
Vârsta: 29 ani
Mesaje: 301
Locatie:
Programator

 
    Postat la 20 Sep 2007 22:18:51    Subiect: < fara subiect >
Deliverance info:

Deliverance:

Multumesc.


Status:
Înregistrat pe:
13 Oct 2006 10:05:37
Vârsta: 25 ani
Mesaje: 253
Locatie: Iasi , Romania
Programator

 
    Postat la 06 Oct 2007 15:11:58    Subiect: < fara subiect >
Rumburak info:

Rumburak:

E o functie in documentatia de DirectX SDK pentru camera daca te intereseaza... Am aplicat-o cu succes in orice situatie si pare mai simpla decat ce faci tu Very Happy


Status:
Înregistrat pe:
03 Oct 2007 00:58:10
Vârsta: ? ani
Mesaje: 5
Locatie:


 

Pagina 2 din 2 [ 1 | 2 ]


Server time: 16:34:22 23.05.2012



[ Termeni si conditii | Contact | F.A.Q. | Funny Pictures ]

© 2006 - 2012 Copyright 7thFACTOR Entertainment - All rights reserved