POV-Ray : Newsgroups : povray.binaries.images : Monopoly Pieces: 1. The Car Server Time
6 Nov 2024 12:21:25 EST (-0500)
  Monopoly Pieces: 1. The Car (Message 1 to 2 of 2)  
From: Rick Measham
Subject: Monopoly Pieces: 1. The Car
Date: 16 Jan 2005 05:15:00
Message: <web.41ea3cf6be0df80c8fc3d8280@news.povray.org>
I'm attempting to POV the entire monopoly game pieces. I'm new to POV-Ray
and the car holds special interest to me so I thought I'd start with it.
I've attached an orthagonal render for your feedback, as well as the
script.

If you're an experienced POVer, please take a minute to look at my code and
give me some feedback. There's a couple of places where I've learned new
things (like POV has loops!) that I'd change things, but I'm sure there's
more than that.

The file has a dozen cameras in it. I've comented them all out except the
one that did the included render.

My main question is: How do I round off all surfaces? I don't want to remove
the corners on everything and replace them with a cylinder, and I'm
guessing there's an easier way.

Cheers!
Rick

(Image follows script)

__SCRIPT__

#include "colors.inc"

// (c)2005 Rick Measham and licenced under the GPL
// The car is based upon a playing piece from the game Monopoly
// so it's probably copyrighted to them and I'm in big trouble.


// This light probably doesn't need to be a spotlight for
// the final render, but it looks good for other renders ;)
light_source {
  0*x
  color rgb <1,1,1> * 3
  spotlight
  translate <40, 80, 40>
  point_at <0, 0, -3>
  radius 8
  tightness 50
  falloff 12
}


/*  Spare Cameras

 // Top view
 camera {
   location  <0.0, 12.0, -3.0>
   look_at   <0.0, 1.0,  -3.0>
   right     x*image_width/image_height
 }

 // Orthagonal
 camera {
   location  <6.0, 5.0, 5.0>
   look_at   <0.0, 0.0,  -3.0>
   right     x*image_width/image_height
 }

 // Close Side view
 camera {
   location  <-3.0, 2.0, -3.0>
   look_at   <0.0, 1.0,  -3.0>
   right     x*image_width/image_height
 }

 // Top Right
 camera {
   location  <6.0, 5.0, 5.0>
   look_at   <0.0, 0.0,  -3.0>
   right     x*image_width/image_height
 }

 // Top Right
 camera {
   location  <3.0, 4.0, 2.0>
   look_at   <0.0, 1.0,  -2.5>
   right     x*image_width/image_height
 }

 // Side view
 camera {
   location  <8.0, 2.0, -3.0>
   look_at   <0.0, 1.0,  -3.0>
   right     x*image_width/image_height
 }

*/

// Orthagonal
camera {
 orthographic
 location  <6.0, 5.0, 5.0>
 look_at <0.0, 1.0,  -3.0>
 angle 35
}


#declare M_Grey = pigment {Grey * 0.5}
#declare M_Grey_Plastic = material {
 texture {
  pigment {Grey * 0.25}
  finish { diffuse 0.8 specular 0.3 }
 }
}

difference {
 union {
  // Front of bonnet
  sphere {
   <0,0,0>
   1
   scale <1,1,1.3>
   translate <0,1.2,-1>
  }
  cylinder {
   <0,1,0>
   <0,0,0>
   1
   scale <1,1,1.3>
   translate <0,0.2,-1>
  }

  // Radiator Cap
  cylinder {
   <0,2.25,-0.5>
   <0,0.2,-0.5>
   0.2
  }

  // Engine Vents -- make a loop
  sphere {
   <0,0,0>
   0.7
   scale <1,1,0.2>
   translate <0,1.6,-1.25>
  }
  sphere {
   <0,0,0>
   0.7
   scale <1,1,0.2>
   translate <0,1.6,-1.5>
  }
  sphere {
   <0,0,0>
   0.7
   scale <1,1,0.2>
   translate <0,1.6,-1.75>
  }
  sphere {
   <0,0,0>
   0.7
   scale <1,1,0.2>
   translate <0,1.6,-2.0>
  }
  sphere {
   <0,0,0>
   0.7
   scale <1,1,0.2>
   translate <0,1.6,-2.25>
  }
  sphere {
   <0,0,0>
   0.7
   scale <1,1,0.2>
   translate <0,1.6,-2.50>
  }
  // body
  box {
    <-1.0, 0.2, -6>
    < 1.0, 1.2, -1>
  }
  cylinder {
   <0,1.2,-1>
   <0,1.2,-4>
   1
  }

  // Windscreen
  difference {
   sphere {
    <0,1.5,-2.2>
    1
    scale <1.01,1,2>
   }
   box {
    <-2,-1.6,-3.4>
    <2, 4.6,-12.0>
   }
  }

  // Rear of bonnet
  sphere {
   <0,0,0>
   1
   scale <1,1.0,2.0>
   translate <0,1.2,-5.5>
  }
  cylinder {
   <0,1.2,0>
   <0,0.2,0>
   1
   scale <1,1.0,2.0>
   translate <0,0,-5.5>
  }

  // Cockpit Vent
  sphere {
   <0,0,0>
   1
   scale <0.5,1.6,2.3>
   translate <0,0.9,-5>
  }

  // Running Boards
  box {
   <-1.2, 0.3, -2>
   < 1.2, 0.4, -5>
  }
  box {
   <-1.2, 0.3, -2.0>
   < 1.2, 0.7, -2.5>
  }
  cylinder {
   <-1.075, 0.7, -2.375>
   < 1.075, 0.7, -2.375>
   0.125
  }
  sphere {
   <1.075, 0.7, -2.375>
   0.125
  }
  sphere {
   <-1.075, 0.7, -2.375>
   0.125
  }
  cylinder {
   <-1.075, 0.7, -2.125>
   < 1.075, 0.7, -2.125>
   0.125
  }
  sphere {
   <1.075, 0.7, -2.125>
   0.125
  }
  sphere {
   <-1.075, 0.7, -2.125>
   0.125
  }

  // Wheel Arches
  cylinder {
   <-1.17, 0.7,-5.8>
   < 1.17, 0.7,-5.8>
   0.65
  }
  cylinder {
   <-1.17, 0.7,-1.0>
   < 1.17, 0.7,-1.0>
   0.65
  }
 }
 union {
  cylinder {
   <-2,1.8,-4.2>
   <2, 1.8,-4.2>
   0.8
  }
  box {
   <-2,1.8,-3.4>
   <2, 4.6,-5.0>
  }
  // Underbody
  box {
   <-2, -0, 2>
   <2, 0.3, -10>
  }
 }
 material { M_Grey_Plastic }
}
// Wheels
cylinder {
 <-0.9, 0.5,-5.75>
 < 1.15, 0.5,-5.75>
 0.5
 material { M_Grey_Plastic }
}
cylinder {
 <-0.9, 0.5,-1.0>
 < 1.15, 0.5,-1.0>
 0.5
 material { M_Grey_Plastic }
}
cylinder {
 < 0.9, 0.5,-5.75>
 <-1.1, 0.5,-5.75>
 0.5
 material { M_Grey_Plastic }
}
cylinder {
 < 0.9, 0.5,-1.0>
 <-1.1, 0.5,-1.0>
 0.5
 material { M_Grey_Plastic }
}


Post a reply to this message


Attachments:
Download 'car.jpg' (44 KB)

Preview of image 'car.jpg'
car.jpg


 

From: Jim Charter
Subject: Re: Monopoly Pieces: 1. The Car
Date: 16 Jan 2005 10:51:52
Message: <41ea8d98$1@news.povray.org>
Rick Measham wrote:

> 
> My main question is: How do I round off all surfaces? I don't want to remove
> the corners on everything and replace them with a cylinder, and I'm
> guessing there's an easier way.

That is really the only way but there are macros in shapes.inc that will 
do it for you for regular primitives.  There is not an easy way to do it 
along differenced edges.  Along regular differenced edges such as a 
cylinder shape differeced from a plane at a square angle it is still 
possible to do something but for more irregular outcomes such as the 
edge of you car's cockpit it is very difficult.  You are really on you 
own.  Historically, the "purist" solution to this would be by handcoding 
bicubic patches or even handcoded smoothed triangles.  With the advent 
of free and powerful polygon mesh modellers such as Wings 3D, which 
makes edge smoothing trivial, there is less and less use of those 
techniques.  But handcoded or csg bevels are still highly regarded in 
the shire.  Additionally, mesh cn be handcoded then smoothed or 
"subdivided".  ONe relevent link:
http://www.cise.ufl.edu/~xwu/Pov-Sub/.
There may be more I don't know about since I am a Wings 3D
enthusiast.


Post a reply to this message

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