POV-Ray : Newsgroups : povray.general : wheel slice of a sphere : wheel slice of a sphere Server Time
4 Aug 2024 10:20:59 EDT (-0400)
  wheel slice of a sphere  
From: Mario
Date: 2 Jun 2003 10:29:38
Message: <3edb5f52$1@news.povray.org>
Hello again!

Imagine wheel. Now imagine it  cut in half. That is the shape I am trying to
get.

I was able to get that shape by using taking the difference of a sphere and
some cubes, but is there an easier way?

Below is an example of how I do it now, hopefully there is a better way


// file begin

#version 3.5;

#include "colors.inc"
#include "textures.inc"

global_settings {
  assumed_gamma 1.0
  max_trace_level 5
}

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

camera {
  location  <5.5, 4, -20>
  look_at   <5.5, 4, -10>
}

sky_sphere {
  pigment {
    gradient y
    color_map {
      [0.0 rgb <0.6,0.7,1.0>]
      [0.7 rgb <0.0,0.1,0.8>]
    }
  }
}

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

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

plane {               // checkered floor
  y, -2.5
  texture
  {
    pigment {
      checker
      color rgb 1
      color blue 1
      scale 0.5
    }
    finish{
      diffuse 0.8
      ambient 0.1
    }
  }
}


difference {
    sphere {              // reflective sphere
      <5.5, 4, -10>, 2.5
        texture {
            Glass
            scale 4      // Scale by the same amount in all
        }
    }

    // bottom box
    box {
        <3, 1.5, -12.5>
        <8, 4,  -7.5>
        texture {
            Glass
            scale 4      // Scale by the same amount in all
        }
    }

    // front box
    box {
        <3, 4, -12.5>
        <8, 6.5, -10.125>
        texture {
            Glass
            scale 4      // Scale by the same amount in all
        }
    }

    // back box
    box {
        <3, 4, -9.875>
        <8, 6.5, -7.5>
        texture {
            Glass
            scale 4      // Scale by the same amount in all
        }
    }

}


Post a reply to this message

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