POV-Ray : Newsgroups : povray.general : Rotate to face camera Server Time
5 Nov 2024 09:21:38 EST (-0500)
  Rotate to face camera (Message 1 to 3 of 3)  
From: Skip Talbot
Subject: Rotate to face camera
Date: 26 May 2003 23:19:25
Message: <3ed2d93d$1@news.povray.org>
Should be an easy question but the brain doesn't want to think.  How do I
rotate a 2D face or triangle so that it faces the camera?

Skip


Post a reply to this message

From: Sir Charles W  Shults III
Subject: Re: Rotate to face camera
Date: 27 May 2003 01:24:13
Message: <3ed2f67d$1@news.povray.org>
Calculate its perpendicular first.  Any three points define a plane, and
that plane has a perpendicular vector that is often called a "normal".  Rotate
the triangle so that its normal is aimed at the camera location.

Cheers!

Chip Shults
My robotics, space and CGI web page - http://home.cfl.rr.com/aichip


Post a reply to this message

From: Warp
Subject: Re: Rotate to face camera
Date: 27 May 2003 07:24:06
Message: <3ed34ad6@news.povray.org>
Sir Charles W. Shults III <aic### [at] cflrrcom> wrote:
> Rotate
> the triangle so that its normal is aimed at the camera location.

  You should have given some hint on how to do this (it's not that trivial,
after all).
  For a way, see the documentation about transforms.inc (specially about
the Reorient_Trans() macro).

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

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