POV-Ray : Newsgroups : povray.advanced-users : Cavalier perspective Server Time
23 Nov 2024 15:55:17 EST (-0500)
  Cavalier perspective (Message 1 to 5 of 5)  
From: Mike Horvath
Subject: Cavalier perspective
Date: 22 Nov 2015 23:43:01
Message: <56529955$1@news.povray.org>
I have the following camera code. How do change the code to get Cavalier 
projection? Thanks!

https://en.wikipedia.org/wiki/Oblique_projection


Mike

/////////////////////////////////////////////

#local cam_dist =	8;
#local cam_move =	1/2;

		// military
		#local cam_area =	2 * 5/4;
		#local cam_loca =	-z * cam_dist;
		#local cam_dirc =	+z;
		#local cam_rgvc =	+x * cam_area;
		#local cam_upvc =	+y * cam_area * sind(045);
		#local cam_tran = transform
		{
			rotate		+x * 045
			rotate		+y * 045
			translate	+y * cam_move
		}
/*
		// 8-bit video game style
		#local cam_area =	2 * 5/4;
		#local cam_loca =	-z * cam_dist;
		#local cam_dirc =	+z;
		#local cam_rgvc =	+x * cam_area;
		#local cam_upvc =	+y * cam_area * sind(045);
		#local cam_tran = transform
		{
			rotate		+x * 045
			translate	+y * cam_move
		}
*/

camera
{
	orthographic
	location		cam_loca
	direction		cam_dirc
	up				cam_upvc
	right			cam_rgvc
	transform {cam_tran}
}


Post a reply to this message

From: Le Forgeron
Subject: Re: Cavalier perspective
Date: 23 Nov 2015 14:17:41
Message: <56536655$1@news.povray.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Le 23/11/2015 05:43, Mike Horvath a écrit :
> I have the following camera code. How do change the code to get
> Cavalier projection? Thanks!
> 
> https://en.wikipedia.org/wiki/Oblique_projection
> 
> 

> #local cam_dirc =    +z; #local cam_rgvc =    +x * cam_area; #local
> cam_upvc =    +y * cam_area * sind(045);

change cam_dirc to <-1*sqrt(2)/2,-1*sqrt(2)/2,1>

The usual factor for x/y is not sind(045), but that's another story.

And stay away of look_at.

Due to the change to cam_dirc, the position of the camera might need
some adjustment too.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iJwEAQEIAAYFAlZTZlQACgkQhKAm8mTpkW1htQP/Usj3budsVIX2wD2LCbiGRmX5
K8JVE6BojFVPSXXQUei8FakRlnMkRWJXv2IXp3gT5s/to7W+OLaE26VWSImXKN81
8/UKTGA27oLlbJyevXiJJR3ISzYEpWwXGz0WinS8Gyt8mX5bYxaGRHoSNdDf+3dT
+hSjqVwk0mcJEqSc7dY=
=TkcY
-----END PGP SIGNATURE-----


Post a reply to this message

From: Mike Horvath
Subject: Re: Cavalier perspective
Date: 23 Nov 2015 20:09:56
Message: <5653b8e4$1@news.povray.org>
On 11/23/2015 2:17 PM, Le_Forgeron wrote:
> change cam_dirc to <-1*sqrt(2)/2,-1*sqrt(2)/2,1>
>
> The usual factor for x/y is not sind(045), but that's another story.

But sqrt(2)/2 equals sind(045), doesn't it?

Mike


Post a reply to this message

From: Le Forgeron
Subject: Re: Cavalier perspective
Date: 24 Nov 2015 02:31:50
Message: <56541266$1@news.povray.org>
Le 24/11/2015 02:10, Mike Horvath a écrit :
> On 11/23/2015 2:17 PM, Le_Forgeron wrote:
>> change cam_dirc to <-1*sqrt(2)/2,-1*sqrt(2)/2,1>
>>
>> The usual factor for x/y is not sind(045), but that's another story.
>
> But sqrt(2)/2 equals sind(045), doesn't it?

the x/y factor for an orthographic camera should reflect the image 
ratio, as long as you expect something like square pixel and round circle.

a 640x480 image has a ratio of 3:4, which would be reflected with

#local cam_rgvc = +x * camera_area;
#local cap_upvc = +y * camera_area * 3/4;

In fact, image_height & image_width are usually used instead of hard 
coded ratio, when the squareness of pixel is to be kept whatever the 
final image ratio. And in the tradition of cinema on tv, the adjustment 
is done on the horizontal vector instead of the vertical one: a change 
of 3:4 to 16:9 keep the same skyline, but widen or shorten the view 
horizontally. (which is somewhat of a problem for the duel scene of The 
good, the Bad and the Ugly, in which two actors are at each extremity of 
the 2.33 picture... when cutting for 4:3 tv, and still for 16:9 screen, 
they get removed)

sqrt(2)/2 is 0.707, which is not a usual ratio of picture, even when 
inversed to sqrt(2) (1.414), unless you are doing ISO-216 paper print
(All the A5/A4/A3...B5/B4/B3 series have sqrt(2) ratio, but not the C 
serie). But that would be without margin.

computer screens do not have that kind of ratio.

Did I tell that it was another story ?


Post a reply to this message

From: Mike Horvath
Subject: Re: Cavalier perspective
Date: 24 Nov 2015 03:14:39
Message: <56541c6f$1@news.povray.org>
On 11/24/2015 2:31 AM, Le_Forgeron wrote:
> sqrt(2)/2 is 0.707, which is not a usual ratio of picture, even when
> inversed to sqrt(2) (1.414), unless you are doing ISO-216 paper print
> (All the A5/A4/A3...B5/B4/B3 series have sqrt(2) ratio, but not the C
> serie). But that would be without margin.
>
> computer screens do not have that kind of ratio.
>
> Did I tell that it was another story ?
>


I see. I am rendering square pictures only, so did not think to mess 
with the image aspect ratios at all.


Mike


Post a reply to this message

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