POV-Ray : Newsgroups : povray.programming : colour and texture : colour and texture Server Time
25 Apr 2024 20:51:20 EDT (-0400)
  colour and texture  
From: The FD
Date: 8 Dec 2008 07:55:01
Message: <web.493d185b4236b443d3bf6faf0@news.povray.org>
Hello,

I am a beginner in povray. For instance I have a problem of texture and color
for very simple objects that I cannot handle with. Here is how it goes:

The square is made out of 4 sphere_sweep for the corners and cylinders for the
straight parts. The top and bottom cylinders are made out of 20 short
successive cylinders to deal with the color of each separately. Everywhere I am
using the rgbt tool to display the colors, however the 4 sphere_sweep look whity
and faded compared to the rest of the figure. Anyone has an idea how to make the
sphere_sweep look like the cylinders? (Maybe I am not using the clipped_by thing
accurately)

here is the code:


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


  background { color Cyan }

light_source { <0, 15, -15> color White}

  camera {
    location <0, 0, -40>
    look_at  <0, 0, 0>
  }

  plane {<0,0,1>, 10
        pigment {color Grey}
        }

//cap(xcap,ycap,zcap,Size,r,g,b,xrot,yrot,zrot)
#local i=0;
#while (i<20) //to manage the color of the 20 cylinders
    #local r=i/20;
    #local g=0;
    #local b=1-i/20;
    cap(-10+i,10,0,2,r,g,b,0,0,0)
    #local i=i+1;
#end

//anglcap(xpos,ypos,zpos,Size,xrot,yrot,zrot,r,g,b)
anglcap(10,10,0,2,0,0,0,1,0,0)

cylinder{<10+2,10-2,0><10+2,-10,0> 2 open
    texture{pigment{colour rgbt<1,0,0,0.7>}}no_shadow}

anglcap(12,-10,0,2,0,0,270,1,0,0)

#local i=0;
#while (i<20)
    #local r=i/20;
    #local g=0;
    #local b=1-i/20;
    cap(-10+i,-12,0,2,r,g,b,0,0,0)
    #local i=i+1;
#end

anglcap(-10,-12,0,2,0,0,180,0,0,1)

cylinder{<-10-2,-10,0><-10-2,10-2,0> 2 open
    texture{pigment{colour rgbt<0,0,1,0.7>}}no_shadow}

anglcap(-12,8,0,2,0,0,90,0,0,1)

**************************************************************************
**************************************************************************
Here comes the vaisseaux.inc file:

//vaisseaux.inc

#macro cap(xcap,ycap,zcap,Size,r,g,b,xrot,yrot,zrot)

    cylinder{<xcap,ycap,zcap><xcap+1,ycap,zcap> Size open
        texture{pigment{colour rgbt<r,g,b,0.7>}} no_shadow
        rotate<xrot,yrot,zrot>}

#end

#macro anglcap(xpos,ypos,zpos,Size,xrot,yrot,zrot,r,g,b)
        sphere_sweep{ linear_spline 3,<0,0,0>,Size <2,0,0>,Size <2,-2,0>,Size
            texture{pigment{colour rgbt<r,g,b,0.7>}}
            clipped_by{box{<0,-2,0><10,10,-20>}}no_shadow
            rotate<xrot,yrot,zrot>
            translate<xpos,ypos,zpos>}
#end

*****************************************************************************
*****************************************************************************

I apologize for my poor English
Any advice is welcomed

The_FD


Post a reply to this message

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