POV-Ray : Newsgroups : povray.general : Oblique projection Server Time
24 Dec 2024 12:46:37 EST (-0500)
  Oblique projection (Message 1 to 10 of 43)  
Goto Latest 10 Messages Next 10 Messages >>>
From: SharkD
Subject: Oblique projection
Date: 2 Jan 2008 01:15:00
Message: <web.477b2ad4a3477974ea6fcf450@news.povray.org>
How do I achieve oblique projection using POV-Ray? I've tried messing around
with the up and right vectors, but have achieved mixed results. Compare the
following two blocks of code:

camera
{
 location -z*(CameraDistance)
 look_at 0
 direction z*(CameraDistance)
 up y*5/2
 right x*5/2
 rotate <asind(tand(30)),45,0>
}

camera
{
 location -z*(CameraDistance)
 look_at 0
 direction z*(CameraDistance)
 up vnormalize(y-z)*5/2
 right x*5/2
 rotate <asind(tand(30)),45,0>
}

The latter results in no difference. Am I on the right track by messing with the
up and right vectors?

-Mike


Post a reply to this message

From: Tim Attwood
Subject: Re: Oblique projection
Date: 2 Jan 2008 05:22:40
Message: <477b65f0$1@news.povray.org>
> How do I achieve oblique projection using POV-Ray? I've tried messing 
> around
> with the up and right vectors, but have achieved mixed results.

POV 3.6 doesn't support an oblique camera, as close as you will come
is the orthographic camera. However, you can deform your scene
by skewing it with Shear_Trans from transforms.inc, this should
get the same look if used in conjunction with an orthographic camera.

MegaPOV has a user defined camera, you might be able to
define an oblique camera there, but I haven't tested it.

#version 3.6;

#include "colors.inc"
#include "transforms.inc"

camera {
   orthographic
   location  <0.0, 0.3, -2.0>
   direction z
   right     x*image_width/image_height
   up y
   look_at   <0.0, 0.1,  0.0>
}

background {White}

light_source {
  <-10, 30, -30>
  color rgb <1, 1, 1>
}

light_source {
  <20, 30, -30>
  color rgb <0.2, 0.2, 0.4>
  shadowless
}

#declare blgs = union {
 box {<0,0,0>,<0.2,0.2,0.2>}
 box {<0,0,0.3>,<0.2,0.3,0.5>}
 box {<0,0,0.6>,<0.2,0.2,0.8>}
 pigment {White}
};

#declare scene = union {
 plane {y,-0.001
    pigment{hexagon Yellow*0.5 LimeGreen ForestGreen scale 0.05}
 }
 object {blgs translate <-0.5,0,0>}
 object {blgs translate <-0.2,0,0>}
 object {blgs translate <0.1,0,0>}
}

object {
   scene
   Shear_Trans(<1,0,0>,<0,1,0>,vnormalize(<0.1,0.1,1>))
}


Post a reply to this message

From: Chris B
Subject: Re: Oblique projection
Date: 2 Jan 2008 05:34:10
Message: <477b68a2$1@news.povray.org>
"SharkD" <nomail@nomail> wrote in message 
news:web.477b2ad4a3477974ea6fcf450@news.povray.org...
> How do I achieve oblique projection using POV-Ray? I've tried messing 
> around
> with the up and right vectors, but have achieved mixed results. Compare 
> the
> following two blocks of code:
>
> camera
> {
> location -z*(CameraDistance)
> look_at 0
> direction z*(CameraDistance)
> up y*5/2
> right x*5/2
> rotate <asind(tand(30)),45,0>
> }
>
> camera
> {
> location -z*(CameraDistance)
> look_at 0
> direction z*(CameraDistance)
> up vnormalize(y-z)*5/2
> right x*5/2
> rotate <asind(tand(30)),45,0>
> }
>
> The latter results in no difference. Am I on the right track by messing 
> with the
> up and right vectors?
>
> -Mike
>

Hi Mike,

No, I don't think you're quite on the right track. Glancing at Wikipedia, it 
seems to me as though oblique projection is just orthographic projection but 
with the screen not being at right angles to the line between the camera and 
the look_at point.

If that's what you're after, then I would have thought you'd want to start 
off by using the POV-Ray orthographic camera (see Orthographic Projection in 
the help file) rather than the default perspective camera and then adjusting 
the sizes of the up and right vectors.

Regards,
Chris B.


Post a reply to this message

From: Slime
Subject: Re: Oblique projection
Date: 2 Jan 2008 06:16:04
Message: <477b7274@news.povray.org>
I'm not sure whether this is the problem, but if I were you I'd remove the
"look_at" from your cameras. Look_at is applied after direction, up, right,
and location even if it's specified before them. It might be affecting the
up and right vectors in some way.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Slime
Subject: Re: Oblique projection
Date: 2 Jan 2008 06:20:32
Message: <477b7380@news.povray.org>
Also, if I understand the oblique projection, I think you may be going for
something more like this:

camera
{
    direction < .5, .5, 1 >
    right x*1.3333
    up y
}

This uses the regular right and up vectors but a diagonal direction vector
so that more distant objects are displayed with a horizonal and vertical
offset.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: SharkD
Subject: Re: Oblique projection
Date: 2 Jan 2008 14:45:00
Message: <web.477be8d5443d65d78fa1930b0@news.povray.org>
Sorry I wasn't clear, but I am using immensely distant camera positions, so the
view is essentially the same as when using the orthographic keyword. According
to Wikipedia, all I should need to do is change the up or right vector, but
this isn't working. I'll try some of your solutions.

"SharkD" <nomail@nomail> wrote:
> How do I achieve oblique projection using POV-Ray? I've tried messing around
> with the up and right vectors, but have achieved mixed results. Compare the
> following two blocks of code:
>
> camera
> {
>  location -z*(CameraDistance)
>  look_at 0
>  direction z*(CameraDistance)
>  up y*5/2
>  right x*5/2
>  rotate <asind(tand(30)),45,0>
> }
>
> camera
> {
>  location -z*(CameraDistance)
>  look_at 0
>  direction z*(CameraDistance)
>  up vnormalize(y-z)*5/2
>  right x*5/2
>  rotate <asind(tand(30)),45,0>
> }
>
> The latter results in no difference. Am I on the right track by messing with the
> up and right vectors?
>
> -Mike


Post a reply to this message

From: SharkD
Subject: Re: Oblique projection
Date: 2 Jan 2008 14:45:01
Message: <web.477be9b9443d65d78fa1930b0@news.povray.org>
Removing "look_at" causes the scene to not render at all (without errors, too).

"Slime" <fak### [at] emailaddress> wrote:
> I'm not sure whether this is the problem, but if I were you I'd remove the
> "look_at" from your cameras. Look_at is applied after direction, up, right,
> and location even if it's specified before them. It might be affecting the
> up and right vectors in some way.
>
>  - Slime
>  [ http://www.slimeland.com/ ]


Post a reply to this message

From: SharkD
Subject: Re: Oblique projection
Date: 2 Jan 2008 14:50:01
Message: <web.477bea70443d65d78fa1930b0@news.povray.org>
Oblique projection should be achieved by simply skewing the projection plane. It
shouldn't matter if you modify "direction", or "right" and "up". I prefer not
messing with the direction, as that makes more sense in my mind.

"Slime" <fak### [at] emailaddress> wrote:
> Also, if I understand the oblique projection, I think you may be going for
> something more like this:
>
> camera
> {
>     direction < .5, .5, 1 >
>     right x*1.3333
>     up y
> }
>
> This uses the regular right and up vectors but a diagonal direction vector
> so that more distant objects are displayed with a horizonal and vertical
> offset.
>
>  - Slime
>  [ http://www.slimeland.com/ ]


Post a reply to this message

From: Trevor G Quayle
Subject: Re: Oblique projection
Date: 2 Jan 2008 15:20:00
Message: <web.477bf0d5443d65d7c150d4c10@news.povray.org>
"SharkD" <nomail@nomail> wrote:
> Oblique projection should be achieved by simply skewing the projection plane. It
> shouldn't matter if you modify "direction", or "right" and "up". I prefer not
> messing with the direction, as that makes more sense in my mind.
>
> "Slime" <fak### [at] emailaddress> wrote:
> > Also, if I understand the oblique projection, I think you may be going for
> > something more like this:
> >
> > camera
> > {
> >     direction < .5, .5, 1 >
> >     right x*1.3333
> >     up y
> > }
> >
> > This uses the regular right and up vectors but a diagonal direction vector
> > so that more distant objects are displayed with a horizonal and vertical
> > offset.
> >
> >  - Slime
> >  [ http://www.slimeland.com/ ]

I think true oblique projection is impossible from camera settings alone as it
has no direct correlation to any single camera viewing projection.  The front
views are show face on as in orthographic projection, but the sides are give a
forced 3d look by skewing them.  To achieve this with a camera, it would need
to have two viewing vectors, one for viewing the face-on surfacesand another
for the sides.
You can try to fake it with orthographic viewing (or a really far perspective
view) and try to get the up and right vectors oriented to kep the desired
'front' face prependicular, but this will still be just an orthographic
projection and not true oblique.

The only real way to do it would be to use a matrix transform to skew your
objects instead as has already been suggested.

-tgq


Post a reply to this message

From: SharkD
Subject: Re: Oblique projection
Date: 2 Jan 2008 16:40:00
Message: <web.477c042f443d65d78fa1930b0@news.povray.org>
"Trevor G Quayle" <Tin### [at] hotmailcom> wrote:
> The only real way to do it would be to use a matrix transform to skew your
> objects instead as has already been suggested.
>
> -tgq

Either way, the code I provided should result in an image that appears taller
than it is wide (similar to adjusting the height of the output image without
changing the up and right vectors). This is not happening, and I can't figure
out why.


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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