POV-Ray : Newsgroups : povray.general : Translate a point : Re: Translate a point Server Time
10 Aug 2024 15:23:39 EDT (-0400)
  Re: Translate a point  
From: Bill DeWitt
Date: 30 Nov 1999 11:43:09
Message: <3843fe9d@news.povray.org>
"Ron Parker" <ron### [at] povrayorg> wrote :
>
> There's no way to do that
>

    That's what I was starting to think.

    Here's what I want to do:

    I have the sigcam() cut down to the basics without the text functions. I
want to use it to build a prism, hopefully by writing:
    prism{blahblah
                <SigCam(x1, camerainfo),SigCam(y1, camerainfo)>
                <SigCam(x2, camerainfo),SigCam(y2, camerainfo)>
                <SigCam(x3, camerainfo),SigCam(y3, camerainfo)>
              }///end prism
... or something to that effect.  But to do this I need to be able to
transform a point somehow.  Either that or I have to build the prism, then
scale and translate it with the SigCam. That's probably what I will end up
doing... unless there is something I can't see right now.

The works of the SigCam() for those who haven't looked at it, are...

#macro SigCam (
                ///(add point location info),
                camera_location,
                camera_right,camera_up,camera_direction,
                camera_sky,camera_angle,camera_look_at
               )

#local autotext_t = camera_location;
#local autotext_z =
vnormalize (camera_look_at-camera_location)
  /2
  *vlength(camera_right)
  /tan(radians(camera_angle/2));

#local autotext_x = vnormalize(vcross(camera_sky,autotext_z));
#local autotext_y = vnormalize(vcross(autotext_z,autotext_x));

object {
                MyObject
                texture{TextTetxure}
                translate 0.2
                translate <0.666,0.50,0> /////// change these to move around
screen
              }
        no_shadow translate z scale 0.001
        matrix  <
                  autotext_x.x,autotext_x.y,autotext_x.z,
                  autotext_y.x,autotext_y.y,autotext_y.z,
                  autotext_z.x,autotext_z.y,autotext_z.z,
                  autotext_t.x,autotext_t.y,autotext_t.z
                >
        }/// end object


Post a reply to this message

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