POV-Ray : Newsgroups : povray.binaries.images : New Macro Test Server Time
2 Nov 2024 16:09:24 EDT (-0400)
  New Macro Test (Message 1 to 3 of 3)  
From: John VanSickle
Subject: New Macro Test
Date: 25 Sep 2010 19:28:33
Message: <4c9e85a1@news.povray.org>
There is in film something called the rule of thirds, which says that 
for many shots, the main item of interest should be positioned one-third 
of the way across the screen, either from the right or from the left.

I decided to write a macro to make it easier to point the camera so that 
an item of interest falls along one of these two lines.  For a test I 
simply re-used the scene from my last post (titled "Old School") with a 
couple of light sources taken away (one was positioned at the camera 
location, and the other was far off in the +x direction).

Here are the macros.  There is one for positioning to the left, and 
another for positioning to the right.

#macro PlaceLeftThird(pCamLoc,pCamEye,vCamSky,sCamZoom)
   #local vD=vnormalize(pCamEye-pCamLoc);
   #local vR=vnormalize(vcross(vCamSky,vD));
   #local sD=vlength(pCamEye-pCamLoc)/sCamZoom * image_width/image_height/6;
   (pCamEye+vR*sD)
#end

#macro PlaceRightThird(pCamLoc,pCamEye,vCamSky,sCamZoom)
   #local vD=vnormalize(pCamEye-pCamLoc);
   #local vR=vnormalize(vcross(vCamSky,vD));
   #local sD=vlength(pCamEye-pCamLoc)/sCamZoom * image_width/image_height/6;
   (pCamEye-vR*sD)
#end

In these macros, pCamLoc is the location of the camera, pCamEye is the 
location of the item that is to appear towards the left or towards the 
right, vCamSky is the direction of the sky vector used in the scene (y 
for the scenes I do), and sCamZoom is the length of the direction vector 
used in the camera.

The macro returns a value which should be used as the look_at value in 
the camera definition.

An example of macro use:

camera {
   location <100,20,-300>
   direction z*2.5
   look_at PlaceLeftThird(<100,20,-300>,<100,15,-100>,y,2.5)
}

If you use this in a right-handed scene (+x is right, +y is forward, +z 
is up) and this causes problems, let me know.

A sample pic is attached.

Regards,
John


Post a reply to this message


Attachments:
Download '70lights.png' (162 KB)

Preview of image '70lights.png'
70lights.png


 

From: Thomas de Groot
Subject: Re: New Macro Test
Date: 26 Sep 2010 02:58:59
Message: <4c9eef33@news.povray.org>
"John VanSickle" <evi### [at] hotmailcom> schreef in bericht 
news:4c9e85a1@news.povray.org...
> There is in film something called the rule of thirds, which says that
> for many shots, the main item of interest should be positioned one-third
> of the way across the screen, either from the right or from the left.

Yes indeed, and it is something one does more or less intuitively I guess... 
At least, I do often :-)

>
> I decided to write a macro to make it easier to point the camera so that
> an item of interest falls along one of these two lines.  For a test I
> simply re-used the scene from my last post (titled "Old School") with a
> couple of light sources taken away (one was positioned at the camera
> location, and the other was far off in the +x direction).
>
Many thanks for this. Very helpful.

Thomas


Post a reply to this message

From: Anthony D  Baye
Subject: Re: New Macro Test
Date: 26 Sep 2010 17:35:01
Message: <web.4c9fb9e7d7d13dfd507e8a090@news.povray.org>
You might also try the golden section.

http://jakegarn.com/the-rule-of-thirds/

Reading the article raises interesting thoughts, such as placing the object of
interest at the convergence of a fib-spiral with the trailing end in one of the
front corners.

I prefer the intuitive approach, however.

just a thought.

A.D.B.

John VanSickle <evi### [at] hotmailcom> wrote:
> There is in film something called the rule of thirds, which says that
> for many shots, the main item of interest should be positioned one-third
> of the way across the screen, either from the right or from the left.
>
> I decided to write a macro to make it easier to point the camera so that
> an item of interest falls along one of these two lines.  For a test I
> simply re-used the scene from my last post (titled "Old School") with a
> couple of light sources taken away (one was positioned at the camera
> location, and the other was far off in the +x direction).
>
> Here are the macros.  There is one for positioning to the left, and
> another for positioning to the right.
>
> #macro PlaceLeftThird(pCamLoc,pCamEye,vCamSky,sCamZoom)
>    #local vD=vnormalize(pCamEye-pCamLoc);
>    #local vR=vnormalize(vcross(vCamSky,vD));
>    #local sD=vlength(pCamEye-pCamLoc)/sCamZoom * image_width/image_height/6;
>    (pCamEye+vR*sD)
> #end
>
> #macro PlaceRightThird(pCamLoc,pCamEye,vCamSky,sCamZoom)
>    #local vD=vnormalize(pCamEye-pCamLoc);
>    #local vR=vnormalize(vcross(vCamSky,vD));
>    #local sD=vlength(pCamEye-pCamLoc)/sCamZoom * image_width/image_height/6;
>    (pCamEye-vR*sD)
> #end
>
> In these macros, pCamLoc is the location of the camera, pCamEye is the
> location of the item that is to appear towards the left or towards the
> right, vCamSky is the direction of the sky vector used in the scene (y
> for the scenes I do), and sCamZoom is the length of the direction vector
> used in the camera.
>
> The macro returns a value which should be used as the look_at value in
> the camera definition.
>
> An example of macro use:
>
> camera {
>    location <100,20,-300>
>    direction z*2.5
>    look_at PlaceLeftThird(<100,20,-300>,<100,15,-100>,y,2.5)
> }
>
> If you use this in a right-handed scene (+x is right, +y is forward, +z
> is up) and this causes problems, let me know.
>
> A sample pic is attached.
>
> Regards,
> John


Post a reply to this message

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