POV-Ray : Newsgroups : povray.newusers : another lightblub question Server Time
5 Nov 2024 03:16:25 EST (-0500)
  another lightblub question (Message 1 to 5 of 5)  
From: Wade
Subject: another lightblub question
Date: 12 Aug 2002 13:00:17
Message: <3d57e9a1$1@news.povray.org>
When I try to scale the lamp itself, I get another lightblub over the lamp.
how do I remove it?  Once again I'm including the lightblub.inc file.
here's the code:

#include "lightblub.inc"
#include "colors.inc"
#include "metals.inc"

#declare Blub = union {
 light_source {
  <0,2,0>
  color rgb <1,1,1>
  area_light x*1, y*1, 2, 2
  adaptive 1
  jitter
  looks_like {Lightblub}
  }
  light_source {
   <0,20,0>
   color Gray75
   fade_distance 10
   fade_power 2
   shadowless
  }
}
#declare Shade =
  cone {
   0, 1, y, 0.5
   texture {
    pigment { marble
     color_map {
      [0/4 color rgbf <1, 1, 1, .4>]
      [1/4 color rgbf <1, 1, 1, .4>]
      [1/4 color rgbf <1, 1, 1, .4>*0.10]
      [2/4 color rgbf <1, 1, 1, .4>*0.10]
      [2/4 color rgbf <1, 1, 1, .4>]
      [3/4 color rgbf <1, 1, 1, .4>*0.10]
      [3/4 color rgbf <1, 1, 1, .4>]
      [4/4 color rgbf <1, 1, 1, .4>]
      }
    turbulence 0.5
    scale 0.25
   }
  }
    finish {ambient 0.2 diffuse 0.5 specular 0.5 roughness 0.05}
    translate y*1.5
}
#declare Radiosity=on;

global_settings {
  assumed_gamma 1.0
  //max_trace_level 25
  #if (Radiosity)
    radiosity {
      pretrace_start 0.08           // start pretrace at this size
      pretrace_end   0.04           // end pretrace at this size
      count 35                      // higher -> higher quality (1..1600)
[35]
      nearest_count 5               // higher -> higher quality (1..10) [5]
      error_bound 1.8               // higher -> smoother, less accurate
[1.8]
      recursion_limit 3             // how much interreflections are
calculated (1..5+) [3]
      low_error_factor .5           // reduce error_bound during last
pretrace step
      gray_threshold 0.0            // increase for weakening colors (0..1)
[0]
      minimum_reuse 0.015           // reuse of old radiosity samples
[0.015]
      brightness 1                  // brightness of radiosity effects
(0..1) [1]

      adc_bailout 0.01/2
      //normal on                   // take surface normals into account
[off]
      //media on                    // take media into account [off]
      //save_file "file_name"       // save radiosity data
      //load_file "file_name"       // load saved radiosity data
      //always_sample off           // turn sampling in final trace off [on]
      //max_sample 1.0              // maximum brightness of samples
    }
  #end
}

#default {
  texture {
    pigment {rgb 1}
    #if (Radiosity)
      finish {
        ambient 0.0
        diffuse 0.6
        specular 0.3
      }
    #else
      finish {
        ambient 0.1
        diffuse 0.6
        specular 0.3
      }
    #end
  }
}

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

camera {
  right x*image_width/image_height
  location  <0,1.5,-4>
  look_at   <0,1,0>
}

light_source {
  <500,500,-500>       // light's position
  color rgb <1, 1, 1>  // light's color
}

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>]
    }
  }
}

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

plane {
  y, 0
  texture {
    pigment {
      checker
      color rgb <1.0, 0.8, 0.6>
      color rgb <1.0, 0.0, 0.0>
      scale 0.5
    }
  }
}

union {
 cylinder {
  0*y .15*y .5
  }
 cylinder {
  0*y 1.5*y .15
 }
 object { Blub }
 object { Shade }
 scale 0.5
 texture { pigment { color Black } finish { F_MetalB } } }

__________________________________________________________________ Wade
Markham ICQ#: 44258048 Current ICQ status: + More ways to contact me i See
more about me:
__________________________________________________________________


Post a reply to this message


Attachments:
Download 'lightblub.inc.txt' (1 KB)

From: Dawn McKnight
Subject: Re: another lightblub question
Date: 12 Aug 2002 14:35:10
Message: <3D580046.5080706@earthlink.net>
Remember that if you scale anything that isn't at the origin, you're not 
only scaling the object, you're scaling its distance from the origin. 
 Without rendering your code snippet here, I'd be willing to bet that 
what you're seeing isn't a second lightbulb, but the original lightbulb, 
displaced by your scaling.


Post a reply to this message

From: Ken
Subject: Re: another lightblub question
Date: 12 Aug 2002 20:44:11
Message: <3D5856D9.40C0B537@pacbell.net>
Wade wrote:

>  Once again I'm including the lightblub.inc file.
> __________________________________________________________________
> 
>                  Name: lightblub.inc
> lightblub.inc    Type: Edit File (application/x-unknown-content-type-INC_auto_file)
>              Encoding: x-uuencode

Please do not post attachments to a non-binary group such as this one.

Thanks for your support,

-- 
Ken Tyler - Server Admin.


Post a reply to this message

From: Tom Melly
Subject: Re: another lightblub question
Date: 13 Aug 2002 04:40:49
Message: <3d58c611$1@news.povray.org>
"Wade" <Zav### [at] aolcom> wrote in message news:3d57e9a1$1@news.povray.org...

<snip>

You need to play around with transformations (scale, rotate, translate) to make
sure you understand what is going on.

For example, what will happen to the position of the following two spheres if
you scale them by two?

sphere{<0,0,0>,1}
sphere{<2,0,0>,1}

The thing to understand is that when you scale an object, the only point of that
object that will stay still is the point at <0,0,0> (if it has a point in that
position) - all other points will move.


Post a reply to this message

From: Dawn McKnight
Subject: Re: another lightblub question
Date: 13 Aug 2002 14:23:36
Message: <3D594F13.2060707@earthlink.net>
Tom Melly wrote:

>The thing to understand is that when you scale an object, the only point of that
>object that will stay still is the point at <0,0,0> (if it has a point in that
>position) - all other points will move.
>

This happens because POV scales objects by multiplying all points in an 
object by the specified scaling factor.  In the example Tom gave (which 
I edited out), the sphere at 2*x will move to 4*x, as well as doubling 
in size.  It will not move along any of the other axies, because 
0*anything = 0.  This is the same reason that an object at the origin 
will remain at the origin.


Post a reply to this message

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