POV-Ray : Newsgroups : povray.newusers : Sky external Image? : Re: Sky external Image? Server Time
5 May 2024 09:52:06 EDT (-0400)
  Re: Sky external Image?  
From: Chrisir
Date: 15 Jul 2009 17:25:00
Message: <web.4a5e484441a4106c9480b1a20@news.povray.org>
Hello,

Here is my code, but the image bit doesn't work...


#macro BigSkyBox ()

/*
- Create a unit box (from <0,0,0> to <1,1,1>)
- Map the texture onto it using the default map_type (parallel projection)
- Translate the box by <-0.5,-0.5,-0.5> to be centered at <0,0,0>
- Scale the box non-uniformly by, say, 10000 and 10000*image_heigh/image_width
units, respectively
- Rotate the box to match the actual camera orientation (*)
- Translate the box to be centered at the actual camera location

(*) Ideally you use some suitable formulae here; if however you decide to tweak
the rotation manually, do the fine-tuning of the rotation parameters when you
have already implemented the final translation.
*/

// create a box that extends between the 2 specified points
box {
  < 0,  0,  0>  // one corner position <X1 Y1 Z1>
  < 1,  1,  1>  // other corner position <X2 Y2 Z2>
  scale 1000 //  <22111.0,  11111.0,  11111.0> // <dX, dY, dZ>
  translate <-1600, 0, 220>  // <dX, dY, dZ>
  texture {
     material_map {
        jpeg "sky02.jpg" // the file to read (iff/tga/gif/png/jpeg/tiff/sys)
        map_type 0        // 0=planar, 1=spherical, 2=cylindrical, 5=torus
        interpolate 0     // 0=none, 1=linear, 2=bilinear, 4=normalized distance
        once           // for no repetitive tiling
        texture { pigment { } }  // texture for color index # 0
        texture { pigment { } }  // texture for color index # 1
        texture { pigment { } }  // texture for color index # 2
     } // material_map
     scale 100000
  }  // texture
}
#end // macro

BigSkyBox ()


Thanks again!

Chris


Post a reply to this message

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