Matrix functions having no effect?

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Post Reply
kazade
Insane DCEmu
Insane DCEmu
Posts: 145
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Tue May 02, 2017 3:11 pm
Has thanked: 3 times
Been thanked: 34 times

Matrix functions having no effect?

Post by kazade »

For some reason I can't get any of the mat_trans functions to affect the output...

Code: Select all

    vout.x = (float) *(ptr++);
    vout.y = (float) *(ptr++);
    vout.z = (float) (VERTEX_POINTER.size > 2) ? *(ptr++) : 0;

    mat_load(&MODELVIEW_STACK.top().m);
    mat_trans_single3_nodiv(vout.x, vout.y, vout.z);

    printf("%f %f %f\n", MODELVIEW_STACK.top().m[3][0], MODELVIEW_STACK.top().m[3][1], MODELVIEW_STACK.top().m[3][2]);
    printf("%f %f %f\n", vout.x, vout.y, vout.z);
The first statement here prints: -1.500000 0.000000 -6.000000 (the rest of the matrix is identity).

But the output is the same as the input... any ideas?
nymus
DC Developer
DC Developer
Posts: 968
Joined: Tue Feb 11, 2003 4:12 pm
Location: In a Dream
Has thanked: 5 times
Been thanked: 6 times

Re: Matrix functions having no effect?

Post by nymus »

My first thought was it might be undefined behaviour because of the *(ptr++) inside the >? : but it works so...
behold the mind
inspired by Dreamcast
Post Reply