www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/22/19:55:53

From: Lee <lklusr AT mbox4 DOT removethis DOT singnet DOT com DOT sg>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: HELP : Scaling
Date: Tue, 23 Feb 1999 08:45:30 +0800
Organization: Singapore Telecommunications Ltd
Lines: 46
Message-ID: <36D1FA2A.9A2B0EDB@mbox4.removethis.singnet.com.sg>
References: <36D16086 DOT F3CB5E2 AT mbox4 DOT removethis DOT singnet DOT com DOT sg>
NNTP-Posting-Host: qtns05027.singnet.com.sg
Mime-Version: 1.0
X-Mailer: Mozilla 4.04 [en] (Win95; I)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

i've made a small modification to TransformObj(). when the object is
rotated, it seems as if the axis is located at screen coordinates 0, 0.

how do i select my own axis to rotate the object?

=======================================================================

void TransformObj(int mode, float x, float y, float z, Object *MyObject)
{
    int counter;
    float dummy; // use to hold useless z coordinate output, since 2d
(x, y) involve only
    MATRIX_f TransMatrix; // Transformation Matrix

    switch(mode) { 
        case TRANSLATEMODE:
            get_translation_matrix_f(&TransMatrix, x, y, z);
            break;
        case SCALEMODE:
            get_scaling_matrix_f(&TransMatrix, x, y, z);
            break;
        case ROTATEMODE:
            get_rotation_matrix_f(&TransMatrix, x, y, z);
            break;
    }

    for (counter = 0; counter < MyObject->NumOfVerts; counter++) {
        apply_matrix_f(&TransMatrix,
                       MyObject->Coord[counter][0],
MyObject->Coord[counter][1], 0,
                       &MyObject->Coord[counter][0],
&MyObject->Coord[counter][1], &dummy);
    }
}


-- 
regards,
lee.

===========================================================
figure out what to remove in email address. i tire of spam.
===========================================================
Suppose you were an idiot. And suppose you were a member of 
Congress. But I repeat myself. -- Mark Twain
===========================================================

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019