Author Topic: Housing.inc (Pov include file)  (Read 924 times)

Offline Voss

  • Silver Member
  • ****
  • Posts: 1261
      • http://www.bombardieraerospace.com
Housing.inc (Pov include file)
« on: February 21, 2001, 10:47:00 AM »
[source]
//From Housing.pov -- Voss
//Originally setup for MP 0.6
//Instrument Gauge Housing; P-51D/K
//Details: scale instrument housing typical of P-51D/K

#version unofficial MegaPov 0.6;

#declare HousingScrews = difference {
   sphere { <0,0,0>,.05 }
      union { box { <-.0075,-.0475,-.051>,<.0075,.0475,-.035> }
         box { <-.0475,-.0075,-.051>,<.0475,.0075,-.035> } } }

#declare HoldDowns = union {
      object { HousingScrews rotate 143*z translate <-.75,.75,0> scale <1,1,.5> }
      object { HousingScrews rotate 43*z translate <-.75,-.75,0> scale <1,1,.5> }
      object { HousingScrews rotate 14*z translate <.75,.75,0> scale <1,1,.5> }
      object { HousingScrews rotate -53*z translate <.75,-.75,0> scale <1,1,.5> }
         texture { pigment { color rgb -.1 }
            finish { ambient 0 diffuse 1 phong .05 phong_size 100 specular .4 reflection_min .025 reflection_max .03 } } }

#declare ScratchedEdges = texture { pigment { color rgb 0 }
   finish { ambient 0 diffuse 1 phong .05 phong_size 100 specular .4 reflection_min .025 reflection_max .03 }
   normal { leopard .6
      normal_map {
         [0 crackle 0 ]
         [.49 crackle 0 ]
         [.491 waves 1 ]
         [.81 waves 1 ]
         [.811 crackle 0 ]
         [1 crackle 0 ] } } scale <.003,.003,.1> }

#declare GaugeHousing = union {
   union {
      difference {
         intersection {
         intersection {
               sphere { <0,0,0>,1 scale <1,1.5,.0251> }
               sphere { <0,0,0>,1 scale <1.5,1,.0251> } }
            box { <-.975,-.975,-.2>,<.975,.975,.2> } }
         cylinder { <0,0,-.6>,<0,0,.6>,.95 } }
      torus { .925,.05 rotate 90*x }
   texture { ScratchedEdges } }
      object { HoldDowns } }
[/source]

Offline Jimdandy

  • Zinc Member
  • *
  • Posts: 46
Housing.inc (Pov include file)
« Reply #1 on: February 21, 2001, 10:54:00 AM »
Boy that ain't lingo I ever seen before. You from around these parts?   What is it Voss? Is it a program of some kind? Last thing I ever programmed in was FORTRAN.

[This message has been edited by Jimdandy (edited 02-21-2001).]

Offline Voss

  • Silver Member
  • ****
  • Posts: 1261
      • http://www.bombardieraerospace.com
Housing.inc (Pov include file)
« Reply #2 on: February 21, 2001, 10:57:00 AM »
heh,... no. I ain't electrical.

It's pov code. You enter this into the editor and out comes a pretty picture. Only this is an include file, you have to be able to setup scenes in order to render this.

Here, I'll go add the scene to generate something for you. You can get the software for free at:  http://www.povray.org

You can find the MegaPov executable over at:
 http://nathan.kopp.com/patched.htm

Install Pov and watch the demo rendering run. On modern day systems this should take under 1 minute. Once you have the software, and given that Pov artists share their code (hasn't been a problem for ten years), then you can render the same thing they post. You can then use these objects in other art works, as long as you cite the author of the code, etc. Observe their rights is all they are asking. However, Pov art is free and clear, so if you make an image of a Thunderbolt cockpit, and you use my dash components, just cite me. Now if it comes down to money (if you make any money off of your code with my code imbedded) I have a problem. I expect you to code your own stuff and not just cut-n-paste. If you create something unique and of your own you are free to use it for profit, just make sure you are doing the work  

To get this to render what you do is copy the two files into an empty folder (directory) and then open the Housing.pov file into the Pov editor. Hit "Alt-g" and you'll have a really nice housing in a matter of a minute or so.

Play, and learn pov at your rate.  

I'll amend to these two posts in a minute. I have to put the official Pov versions up too.

BTW, when we finish making nice models we can use these to make movies and gun camera footage from typical perspectives. Should be interesting.

[This message has been edited by Voss (edited 02-21-2001).]

Offline Voss

  • Silver Member
  • ****
  • Posts: 1261
      • http://www.bombardieraerospace.com
Housing.inc (Pov include file)
« Reply #3 on: February 21, 2001, 11:30:00 AM »
Update:

Any textures of mine, that you use here, are mine. Cite me. If you make money on it, cite me. That's all *I* ask.

I have very nice aluminum, and plexiglass, and a few other finishes we might get to down the road, but I don't want your money. Just cite me.

"Some texture, or textures, in this image created from code by Paul "Voss" Hinds."

If you are so inclined you can also cite me as "GrimDude," which is my Pov artist handle (and my Quake persona).

Offline Voss

  • Silver Member
  • ****
  • Posts: 1261
      • http://www.bombardieraerospace.com
Housing.inc (Pov include file)
« Reply #4 on: February 21, 2001, 11:48:00 AM »
Here is the official version of Housing.inc. This requires the *official* Pov-Ray executable. The original posting in this thread assumed the MegaPov executable, which can handle either version.

[source]
//From Housing.pov -- Voss
//Originally setup for MP 0.6
//Instrument Gauge Housing; P-51D/K
//Details: scale instrument housing typical of P-51D/K

#declare HousingScrews = difference {
sphere { <0,0,0>,.05 }
union { box { <-.0075,-.0475,-.051>,<.0075,.0475,-.035> }
box { <-.0475,-.0075,-.051>,<.0475,.0075,-.035> } } }

#declare HoldDowns = union {
object { HousingScrews rotate 143*z translate <-.75,.75,0> scale <1,1,.5> }
object { HousingScrews rotate 43*z translate <-.75,-.75,0> scale <1,1,.5> }
object { HousingScrews rotate 14*z translate <.75,.75,0> scale <1,1,.5> }
object { HousingScrews rotate -53*z translate <.75,-.75,0> scale <1,1,.5> }
texture { pigment { color rgb -.1 }
finish { ambient 0 diffuse 1 phong .05 phong_size 100 specular .4 reflection .0275 } } }

#declare ScratchedEdges = texture { pigment { color rgb 0 }
finish { ambient 0 diffuse 1 phong .05 phong_size 100 specular .4 reflection .0275 }
normal { leopard .6
normal_map {
[0 crackle 0 ]
[.49 crackle 0 ]
[.491 waves 1 ]
[.81 waves 1 ]
[.811 crackle 0 ]
[1 crackle 0 ] } } scale <.003,.003,.1> }

#declare GaugeHousing = union {
union {
difference {
intersection {
intersection {
sphere { <0,0,0>,1 scale <1,1.5,.0251> }
sphere { <0,0,0>,1 scale <1.5,1,.0251> } }
box { <-.975,-.975,-.2>,<.975,.975,.2> } }
cylinder { <0,0,-.6>,<0,0,.6>,.95 } }
torus { .925,.05 rotate 90*x }
texture { ScratchedEdges } }
object { HoldDowns } }
[/source]


[This message has been edited by Voss (edited 02-21-2001).]

Offline Jimdandy

  • Zinc Member
  • *
  • Posts: 46
Housing.inc (Pov include file)
« Reply #5 on: February 21, 2001, 01:01:00 PM »
Thanks for the info Voss. I'm sure there are a lot of computer literate people out there that are eating this up. I threw most of that out of my brain after I took the classes. Those damn mandatory electives.   I will say that my programing classes and micro processors class ranked much higher than Gender In Culture did with me.   Cool dash in your other post. Looks real. A friend of mine has some old gauges from that era. His dad used to work on airplanes. I don't know what they came out of but they look similar to those. Cool picture.

Offline Voss

  • Silver Member
  • ****
  • Posts: 1261
      • http://www.bombardieraerospace.com
Housing.inc (Pov include file)
« Reply #6 on: February 21, 2001, 01:23:00 PM »
Heya, JimDandy.  

I needed to clarify a few things there anyway. You never know who might come by and start making stuff.

Thanks for the compliments. The gauges are not really rendered as realistic as possible. I wanted to be able to read them all clearly from a single viewpoint, so I modified the ambient values and removed specular highlighting from the gauge lenses. I could tease you further, but I'd rather not just yet. Suffice it to say I have experimented with the (nearly) complete cockpit and under night conditions (heh) the cockpit lamps make things look *really* nice.

Stick around, you might decide to brush off some of those programming skills. I'm going to break it down a little so people can digest the strangeness of the code.

Oh, and I forgot to say (eep) you cannot leave the [source] tags in the code when you render (likewise the [/source]tag). Those are reminders that this came off of a UBB, or NG system and may contain formatting problems.

[This message has been edited by Voss (edited 02-21-2001).]

Offline mason22

  • Gold Member
  • *****
  • Posts: 2654
Housing.inc (Pov include file)
« Reply #7 on: February 21, 2001, 03:02:00 PM »
heya voss, i can't get it to render?

i get an error,
 "scene file parser initialization error."
 "can't open input file"

i know i'm doing sometthing stupid...any clue what it is??

Offline Voss

  • Silver Member
  • ****
  • Posts: 1261
      • http://www.bombardieraerospace.com
Housing.inc (Pov include file)
« Reply #8 on: February 21, 2001, 05:04:00 PM »
Make sure you have both "Housing.inc" and "Housing.pov" saved to the same directory, and that those are the copies you are working with. You render the file "Housing.pov" because if you render the include file there is no camera or light defined, and the housing object is never called. Too, the file has to be saved before you can render it.

I'll check into the specifics of the error message just to make sure that's it.

Offline Voss

  • Silver Member
  • ****
  • Posts: 1261
      • http://www.bombardieraerospace.com
Housing.inc (Pov include file)
« Reply #9 on: February 21, 2001, 07:57:00 PM »
It seems you are probably still naming the file "Housing.inc" instead of "HousingOfficial.inc" which is what the official version of Housing.pov is linking to. You can also just pop the code segments into Housing.pov and comment out the link. Something like this:

[Source]
//Housing.pov -- Voss/GrimDude
//Instrument Housing; P-51D/K

#include "Colors.inc"
#include "Textures.inc"
#include "Metals.inc"

global_settings { max_trace_level 15 assumed_gamma 1 ambient_light 0 }

#declare HousingScrews = difference {
sphere { <0,0,0>,.05 }
union { box { <-.0075,-.0475,-.051>,<.0075,.0475,-.035> }
box { <-.0475,-.0075,-.051>,<.0475,.0075,-.035> } } }

#declare HoldDowns = union {
object { HousingScrews rotate 143*z translate <-.75,.75,0> scale <1,1,.5> }
object { HousingScrews rotate 43*z translate <-.75,-.75,0> scale <1,1,.5> }
object { HousingScrews rotate 14*z translate <.75,.75,0> scale <1,1,.5> }
object { HousingScrews rotate -53*z translate <.75,-.75,0> scale <1,1,.5> }
texture { pigment { color rgb -.1 }
finish { ambient 0 diffuse 1 phong .05 phong_size 100 specular .4 reflection .0275 } } }

#declare ScratchedEdges = texture { pigment { color rgb 0 }
finish { ambient 0 diffuse 1 phong .05 phong_size 100 specular .4 reflection .0275 }
normal { leopard .6
normal_map {
[0 crackle 0 ]
[.49 crackle 0 ]
[.491 waves 1 ]
[.81 waves 1 ]
[.811 crackle 0 ]
[1 crackle 0 ] } } scale <.003,.003,.1> }

#declare GaugeHousing = union {
union {
difference {
intersection {
intersection {
sphere { <0,0,0>,1 scale <1,1.5,.0251> }
sphere { <0,0,0>,1 scale <1.5,1,.0251> } }
box { <-.975,-.975,-.2>,<.975,.975,.2> } }
cylinder { <0,0,-.6>,<0,0,.6>,.95 } }
torus { .925,.05 rotate 90*x }
texture { ScratchedEdges } }
object { HoldDowns } }

//#include "Housing.inc"

GaugeHousing

plane { z,2 pigment { color rgb 1 } hollow }

sky_sphere {
   pigment { gradient y poly_wave 0.75 color_map {
      [0 color rgb 2*<.36,.36,.45>]
      [.35 color rgb 1.75*<.36,.36,.45>] } } }

camera { location <0,0,-2> direction z look_at 0 }
light_source { <-3000,1312,-6000> color rgb 5*<1,1,.5>
   area_light <20,0,0>,<0,20,0>,3,3 adaptive 1 jitter }
[/source]

[This message has been edited by Voss (edited 02-21-2001).]

Offline Sundog

  • Silver Member
  • ****
  • Posts: 1781
Housing.inc (Pov include file)
« Reply #10 on: February 21, 2001, 08:27:00 PM »
Thanks Voss!
I'll need about a week to digest all that (Not that I will understand, just to go through it and decipher some of what is being done there!)
SD

Offline Voss

  • Silver Member
  • ****
  • Posts: 1261
      • http://www.bombardieraerospace.com
Housing.inc (Pov include file)
« Reply #11 on: February 21, 2001, 09:40:00 PM »
Just to drive you nuts...    

The very first object in the Housing include file is declared incorrectly. It works, but Pov has a problem with coincident surfaces in CSG objects and it shows up. Here are two close-ups of the housing screws, which are really just a sphere with two boxes cut away from it.

The original:

[source]
#declare HousingScrews = difference {
   sphere { <0,0,0>,.05 }
      union { box { <-.0075,-.0475,-.051>,<.0075,.0475,-.035> }
         box { <-.0475,-.0075,-.052>,<.0475,.0075,-.035> } } }
[/source]

       

And now the modified:

[source]
#declare HousingScrews = difference {
   sphere { <0,0,0>,.05 }
      union { box { <-.0075,-.0475,-.051>,<.0075,.0475,-.035> }
         box { <-.0475,-.0075,-.052>,<.0475,.0075,-.035> }
         merge { box { <-.0075,-.0475,-.051>,<.0075,.0475,-.035> }
         box { <-.0475,-.0075,-.051>,<.0475,.0075,-.035> } } } }
[/source]

       

There are other optimizations you can make to get better results I'm sure.    


Render the following scene file to get the first image, make the code changes and render again you will have the second image.

[source]
//New Screw Head -- Voss/GrimDude
//Instrument Housing; P-51D/K
#version unofficial MegaPov 0.7;

global_settings { max_trace_level 15 assumed_gamma 1 ambient_light 0 }

#include "Housing.inc"

object { HousingScrews
texture { pigment { color rgb .6 }
   finish { ambient 0 diffuse 1 phong .05 phong_size 100 specular .4 reflection_min .025 reflection_max .03 }
   } scale <1,1,.3> no_shadow }

camera { location <0,0,-.2> direction z look_at 0 }
light_source { <-5,5,-2> color rgb 1 shadowless }
[/source]

[This message has been edited by Voss (edited 02-22-2001).]

Offline Voss

  • Silver Member
  • ****
  • Posts: 1261
      • http://www.bombardieraerospace.com
Housing.inc (Pov include file)
« Reply #12 on: February 27, 2001, 08:13:00 PM »
You will need this code (one flavor or the other) in order to create the "VSI.inc" thread.

------------------
***-*-