POV-Ray : Newsgroups : povray.general : Oblique projection : Re: Oblique projection Server Time
31 Jul 2024 08:23:04 EDT (-0400)
  Re: Oblique projection  
From: Trevor G Quayle
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

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