POV-Ray : Newsgroups : povray.general : Oblique projection Server Time
31 Jul 2024 12:24:44 EDT (-0400)
  Oblique projection (Message 4 to 13 of 43)  
<<< Previous 3 Messages Goto Latest 10 Messages Next 10 Messages >>>
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

From: SharkD
Subject: Re: Oblique projection
Date: 2 Jan 2008 17:05:00
Message: <web.477c0961443d65d78fa1930b0@news.povray.org>
I was looking in the wrong place for the error (I think). On a second attempt I
received an error that non-perpendicular camera vectors cannot be used while
the vista buffer is turned on (I noticed this later in the docs, too). I
commented out the "look_at" statement and turned off the vista buffer, and now
everything works. Thanks! Now all that is left to do is to experiment with the
values until I achieve the projection used in Ultima Online: Kingdom Reborn
(link: http://en.wikipedia.org/wiki/Ultima_Online:_Kingdom_Reborn).

"SharkD" <nomail@nomail> wrote:
> 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: Trevor G Quayle
Subject: Re: Oblique projection
Date: 2 Jan 2008 17:10:00
Message: <web.477c0aa0443d65d7c150d4c10@news.povray.org>
"SharkD" <nomail@nomail> wrote:
> "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.

If you feel like getting megaPOV, you can try this code I threw together which
simply takes an normal orthographic projection and distorts it to simulate an
oblique one (uses the 'camera' pigment)

//START
#version unofficial megapov 1.21;  //set for POV version being used

light_source { <20,  20, -30> rgb 1}
light_source { <20,  20,  30> rgb 1}
light_source { <-20, 20,  30> rgb 1}
light_source { <-20, 20, -30> rgb 1}

box{-2,2
  pigment{rgb <1,0,0>}
}

background{rgb 0}

#declare XX=-10;
#declare ZZ=10;
#declare YY=10;
#declare XZ=sqrt(XX*XX+ZZ*ZZ);
#declare XYZ=sqrt(XZ*XZ+YY*YY);
#declare VIEWSIZE=20;
#declare AR=image_width/image_height;
#declare FFUNC=
function{
  pigment{
    camera_view{
      orthographic
      up y*VIEWSIZE
      right x*VIEWSIZE*AR
      location <XX,YY,ZZ>
      look_at 0
    }
    translate -1/2
    scale 2
  }
}

#declare
FCol=function(x,y,z,comp){select(comp,FFUNC(x,y,z).red,FFUNC(x,y,z).green,FFUNC(x,y,z).blue)}
#declare
FOBL=function(x,y,z,comp){FCol(x*(ZZ/XZ),(y+x*(XX*YY)/(XZ*XZ)*AR)*(XZ/XYZ),0,comp)}

box{<-1/2,-1/2,0>,<1/2,1/2,0>
  texture{
    pigment{
      average
      pigment_map{
        [function{FOBL(x,y,z,-1)} color_map{[0 rgb 0][1 rgb <3,0,0>]}]
        [function{FOBL(x,y,z, 0)} color_map{[0 rgb 0][1 rgb <0,3,0>]}]
        [function{FOBL(x,y,z, 1)} color_map{[0 rgb 0][1 rgb <0,0,3>]}]
      }
    }
    finish{ambient 1 diffuse 0}
  }
  translate -y*5000
}

camera {
  orthographic
  location -10*z
  look_at 0
  up y
  right x
  translate -y*5000
}
//

-tgq


Post a reply to this message

From: Tim Attwood
Subject: Re: Oblique projection
Date: 2 Jan 2008 17:27:43
Message: <477c0fdf$1@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.

The way I understand oblique projection the right (x) and up (y) axis are
perpendicular, but the direction (z) is slanted at an angle. Theoretically
you could define the correct right, up and direction in POV, but POV 3.6
specifically disallows this.  The camera vectors must all be perpendicular
to each other. The look_at command modifies the camera by rotating the
axis vectors, so for clarity it probably should be after any specified
camera axis vectors.


Post a reply to this message

<<< Previous 3 Messages Goto Latest 10 Messages Next 10 Messages >>>

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