POV-Ray : Newsgroups : povray.programming : vtransform function Server Time
25 Dec 2024 22:12:17 EST (-0500)
  vtransform function (Message 1 to 2 of 2)  
From: Chris Huff
Subject: vtransform function
Date: 21 Oct 1999 19:45:03
Message: <380FA609.3D0786CB@yahoo.com>
Changes to add vtransform(VECTOR, TRANSFORM) function to POV-Ray:
(I have left some "land marks" to help you find the right areas in the
code)
++> precedes a line to add

File:EXPRESS.C    Function: Parse_Num_Factor(), in CASE
(VECTOR_FUNCT_TOKEN)
++>       case VTRANSFORM_TOKEN:
++>       {Parse_VTransform(Vect);}break;

          case VAXIS_ROTATE_TOKEN:<--land mark


File:PARSE.H    enum TOKEN_IDS
++>  VTRANSFORM_TOKEN,
  VECTOR_FUNCT_TOKEN,<--land mark

In the global function prototypes:
++>void Parse_VTransform(VECTOR result);

File:TOKENIZE.C    Reserved_Words[]
++>  {VTRANSFORM_TOKEN, "vtransform"},


File: PARSE.C    Add this function:
void Parse_VTransform(VECTOR result)
{
   MATRIX Local_Matrix;
   TRANSFORM *New, Local_Trans;
   VECTOR Local_Vector;
 VECTOR vect;

 GET (LEFT_PAREN_TOKEN);
 Parse_Vector(vect);
 Parse_Comma();
 New = Create_Transform();

   EXPECT
     CASE(TRANSFORM_ID_TOKEN)
       Compose_Transforms (New, (TRANSFORM *)Token.Data);
     END_CASE

     CASE (TRANSFORM_TOKEN)
       GET(TRANSFORM_ID_TOKEN)
       Compose_Transforms(New, (TRANSFORM *)Token.Data);
     END_CASE

     CASE (TRANSLATE_TOKEN)
       Parse_Vector (Local_Vector);
       Compute_Translation_Transform(&Local_Trans, Local_Vector);
       Compose_Transforms (New, &Local_Trans);
     END_CASE

     CASE (ROTATE_TOKEN)
       Parse_Vector (Local_Vector);
       Compute_Rotation_Transform(&Local_Trans, Local_Vector);
       Compose_Transforms (New, &Local_Trans);
     END_CASE

     CASE (SCALE_TOKEN)
       Parse_Scale_Vector (Local_Vector);
       Compute_Scaling_Transform(&Local_Trans, Local_Vector);
       Compose_Transforms (New, &Local_Trans);
     END_CASE

     CASE (MATRIX_TOKEN)
       Parse_Matrix(Local_Matrix);
       Compute_Matrix_Transform(&Local_Trans, Local_Matrix);
       Compose_Transforms (New, &Local_Trans);
     END_CASE

     OTHERWISE
       UNGET
       EXIT
     END_CASE
   END_EXPECT
 GET (RIGHT_PAREN_TOKEN);

 MTransPoint(result, vect, New);
 Destroy_Transform(New);
}


Post a reply to this message

From: Chris Huff
Subject: Re: vtransform function
Date: 21 Oct 1999 19:49:17
Message: <380FA706.6FA23072@yahoo.com>
And now I *can* send a long message without breaking it up into a bunch
of smaller ones...this is really irritating(the inconsistency, not the
fact that I was able to send the previous message).
Oh, well. Hopefully the problem is gone for good.

Now to look for some images to attempt to upload.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.