POV-Ray : Newsgroups : povray.general : Cylindrical projection : Re: Cylindrical projection Server Time
31 Jul 2024 04:14:58 EDT (-0400)
  Re: Cylindrical projection  
From: M a r c
Date: 1 Nov 2007 10:06:06
Message: <4729eb5e@news.povray.org>

web.4729d5115849c6ccf104cee20@news.povray.org...
> Thanks for your answer,
>
> actually i'm going to render some 3d models on a cylindrical screen with a
> projector and i don't know how to reduce the distotion.
> so i'm searching for a way to preduce a distorted screen that looks 
> undistorted
> on the cylindrical screen. Could you help me please?
>
> Thanks in advance.
>
you could try a cylindrical camera as below.
As you see the scene is very simple : a 1/2 cylinder with a radial pattern.
rendered through a cylindrical camera placed on the axis, the pattern 
appears as evenly wide bands.
Is that what you want?

Marc (code below)

#version 3.5;



global_settings {
  assumed_gamma 1.0


}
background { color rgb <0.1, 0.3, 0.8> }

// ----------------------------------------


#declare Cylindrical_projection=1;//Set this value to  1 to render a 
cylindrical projection
#if (Cylindrical_projection)
// cylinder lens for axis distorted field of view
// 1 is vertical cylinder, fixed viewpoint
// 2 is horizontal cylinder, fixed viewpoint
// 3 is vertical cylinder, viewpoint moves along the cylinder's axis
// 4 is horizontal cylinder, viewpoint moves along the cylinder's axis
camera {
  cylinder 1            // types 1, 2 ,3, 4
  location <0,0,0>     // position
  right x*5             // horizontal aspect or field of view
  up y*2                // vertical aspect or field of view
  look_at  <0,0,1>      // view
  angle 181
}

#else

// perspective (default) camera
camera {
  location  <2.0, 2.0, -2.0>
  look_at   <0.0, 0.0,  0.0>
  right     x*image_width/image_height
}
#end


light_source {
  <0, 0, 0>            // light's position (translated below)
  color rgb <1, 1, 1>  // light's color
  translate <-10, 30, -30>
}



// ----------------------------------------



#declare Bandes= pigment{
radial frequency 10
color_map {
  //  [ END_VAL color red R green G blue B filter F transmit T]
  [ 0.5  color rgb 0]

  [ .5  color rgb 1 ]
  // (---alternative form---)
  //[ 1.0  color rgbf <0.8, 0.8, 0.8, 1.0> ]
} // color_map
}

intersection{
cylinder{-y,y*1.1,1 texture{ pigment{Bandes}finish {ambient 0 diffuse 0.6}}}
box{<-1,-1.1,0>,<1,1,1> pigment {color rgbt 1}}
no_shadow}


Post a reply to this message

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