POV-Ray : Newsgroups : povray.general : Sheared orthographic camera Server Time
4 Aug 2024 04:15:06 EDT (-0400)
  Sheared orthographic camera (Message 1 to 6 of 6)  
From: Vadim Sytnikov
Subject: Sheared orthographic camera
Date: 30 Jun 2003 13:10:43
Message: <3f006f13$1@news.povray.org>
Is there a way to create sheared orthographic camera? I need to offset
camera location along *both* X and Y axes (image plane is coplanar with XY),
while leaving camera target (look_at) intact, and have every camera ray
skewed accordingly.

If I offset camera location just along a single axis, I do have the desired
effect. But if I offset along both axes, the image gets distorted badly --
vertical lines are OK, while horizontal lines (i.e. parallel to X axis of
the image) lines get unwanted skew...

In orher words, suppose I have two L-shapes, one strictly above the other,
and render them using orthographic "top" projection (in my coordinate
system, that means "along Z axis"); I get something like this:
  ____
  |
  |

So far, so good. Now I offset camera location along both X and Y axes and
render again; I get something like this (the actual skew is lesser, but you
should get the idea):

   /
  /   /
  |  /
  |  |
     |

while I wanted something like this:

  ____
  |  ____
  |  |
     |


The actual camera definition I used is this (remember that image plane is
coplanar with XY):

camera { orthographic
  location <-60,84,75>
  right x*64
  up -y*48
  look_at <-68,76,0>
  direction <-8,-8,-74>
  sky -y
}

Of course, I could make a patch which would do what I wanted... But I would
like to be sure that that could not be achieved with plain vanilla SDL. So,
any ideas?..


Post a reply to this message

From: Breton Slivka
Subject: Re: Sheared orthographic camera
Date: 30 Jun 2003 23:47:55
Message: <Xns93AAE025BCBACZenPsychoyahoocom@204.213.191.226>
I can't say I perfectly understand what you're getting at, but if I am 
understanding correctly, what you want is not a function of the camera, but 
a function of the scene. that is, you should wrap the scene in a union and 
shear the whole thing. 

Just a guess.


Post a reply to this message

From: Vadim Sytnikov
Subject: Re: Sheared orthographic camera
Date: 1 Jul 2003 11:18:18
Message: <3f01a63a$1@news.povray.org>
"Breton Slivka" <blah> wrote:
> I can't say I perfectly understand what you're getting at

Based upon you suggestion, I can say you did understand it pretty well.

> what you want is not a function of the camera, but
> a function of the scene. that is, you should wrap the scene
> in a union and shear the whole thing.

Nope... unfortunately. First of all, not everything can easily be put into a
union; for instance, there is good deal of spotlights etc. that all would
have to be handled separately. Because of this and other similar reasons, I
would very much prefer to adjust camera instead.

Even more important: I have great number of small objects (especially
meshes) in my scenes, which are BTW rendered into animations. I took great
pains *not* to employ transformations whenever possible, but instead use
proper creation parameters -- transformations hurt performance quite
badly... All in all, I would like to tweak camera instead of messing with
objects.

Thanks for the suggestion though.


Post a reply to this message

From: Breton Slivka
Subject: Re: Sheared orthographic camera
Date: 1 Jul 2003 16:51:31
Message: <Xns93AB998F24073ZenPsychoyahoocom@204.213.191.226>
hold up, I've got a solution.

Try rendering this scene, and let me know what you think. 


camera { orthographic
  location <-1,-1,-1>
  right 2*x
  up 2*y
  look_at <0,0,0>
  sky -y
 
matrix
<
  1,     -0.5,  0,      
  0,        1,  0,       
  0,        0,  1,
  0,        0,  0        
>
}

box {  -0.5, 0.5  pigment { color rgb 1 }}
light_source {   0*x  color rgb <1,1,1>  translate <-20, 40, -20> }


Post a reply to this message

From: Vadim Sytnikov
Subject: Re: Sheared orthographic camera
Date: 2 Jul 2003 13:29:01
Message: <3f03165d@news.povray.org>
"Breton Slivka" wrote:
> hold up, I've got a solution.
>
> matrix
> <

Doh! It actually did the trick. Thank you. Although I had to turn off vista
buffer...

Funny thing about it is that I, of course, did consider using 'matrix', but
before trying it I had a look at Transform_Camera() in camera.cpp and
somehow decided that 'matrix' would do exactly what I'm doing with
'look_at', 'location' etc. myself. It turns out that I was wrong... It seems
like, when I'm trying to skew camera w/o matrix, 'right' and 'up' vectors
get altered to make them perpendicular to the <location-look_at> vector,
which I did not expect. That's... not quite consistent of POV, I would say.


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Sheared orthographic camera
Date: 2 Jul 2003 15:55:45
Message: <3f0338c1@news.povray.org>
In article <3f03165d@news.povray.org> , "Vadim Sytnikov" <syt### [at] rucom>
wrote:

>  It turns out that I was wrong... It seems
> like, when I'm trying to skew camera w/o matrix, 'right' and 'up' vectors
> get altered to make them perpendicular to the <location-look_at> vector,
> which I did not expect. That's... not quite consistent of POV, I would say.

Look_at is just an alternate representation of several of the other
parameters.  You cannot adjust both representations and expect POV-Ray to
guess which one or combination to use.  That is why POV-Ray 3.5 does apply
all parameters in a well-specified order.

Using matrix is the way to go for your problem unless you don't want to use
look_at.

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

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