POV-Ray : Newsgroups : povray.newusers : Problem making a bumpy surface : Re: Problem making a bumpy surface Server Time
7 Jul 2024 08:21:06 EDT (-0400)
  Re: Problem making a bumpy surface  
From: Leroy Whetstone
Date: 5 Mar 2010 00:29:02
Message: <4B909619.3010206@joplin.com>
Darats wrote:
> Hi there,
> 
> Here is my problem :
> 
> I have and object, a simple mesh for example :
> 
> I would like to declare it with no color but just with a bumby surface.
> 
> Lets see a code (just an example, it will not work like this)
> 
> 
> #declare stuff =
> 
> mesh {
>   triangle { <1,13.2146,-23.2146>, <3,14.286,-24.286>, <17,14.286,-24.286> }
>   triangle { <17,14.286,-24.286>, <19,13.2146,-23.2146>, <1,13.2146,-23.2146> }
>   triangle { <19,13.2146,-23.2146>, <17,14.286,-24.286>, <17,18.2146,-28.2146> }
>   triangle { <17,18.2146,-28.2146>, <19,19.2861,-29.2861>, <19,13.2146,-23.2146>
> }
>   triangle { <19,19.2861,-29.2861>, <17,18.2146,-28.2146>, <3,18.2146,-28.2146>
> }
>   triangle { <3,18.2146,-28.2146>, <1,19.2861,-29.2861>, <19,19.2861,-29.2861> }
>   triangle { <1,19.2861,-29.2861>, <3,18.2146,-28.2146>, <3,14.286,-24.286> }
>   triangle { <3,14.286,-24.286>, <1,13.2146,-23.2146>, <1,19.2861,-29.2861> }
>   triangle { <3,15.7146,-25.7146>, <17,15.7146,-25.7146>, <17,16.786,-26.786> }
>   triangle { <17,16.786,-26.786>, <3,16.786,-26.786>, <3,15.7146,-25.7146> }
>   triangle { <5,14.286,-24.286>, <7,14.286,-24.286>, <7,18.2146,-28.2146> }
>   triangle { <7,18.2146,-28.2146>, <5,18.2146,-28.2146>, <5,14.286,-24.286> }
>   triangle { <9,14.286,-24.286>, <11,14.286,-24.286>, <11,18.2146,-28.2146> }
>   triangle { <11,18.2146,-28.2146>, <9,18.2146,-28.2146>, <9,14.286,-24.286> }
>   triangle { <13,14.286,-24.286>, <15,14.286,-24.286>, <15,18.2146,-28.2146> }
>   triangle { <15,18.2146,-28.2146>, <13,18.2146,-28.2146>, <13,14.286,-24.286> }
>    }
>  mesh {
>   triangle { <1,11.7859,-21.7859>, <19,11.7859,-21.7859>, <19,13.2146,-23.2146>
> }
>   triangle { <19,13.2146,-23.2146>, <1,13.2146,-23.2146>, <1,11.7859,-21.7859> }
>                 normal { bumps 1 scale 25*0.02 }
> 
>  }
> }
> 
> 
> 
> #declare Scene = object {
> 
>   stuff
> 
>   material { Red }
>  }
> #end
> 
> 
> 
> So it doesn't work.
> 
> With this code I can only have the first mesh in red, the other stays black. If
> I remove the bumps, the second mesh has now the right color, but no bumps.
> 
> And I can't put the color directly when I'm creating the object, it has to be
> uncolored but with bumps, and then colored (keeping the bumps).
> 
> 
> I hope you see what I am trying to mean. Thank you for your help.
> 
> 

First, what you have written here, Stuff only equals the first mesh, So 
when you use 'object' the second mesh is not textured.
Your use of 'material { Red }' and the  '#end' suggests that 'Red' is 
defined as a texture and interior somewhere and that the whole code is 
inside an '#if' or a '#macro' statement.
  If what you want is both meshes to be the same color but the first to
have no normal and the second to have a normal. You can use something 
like this:
  #declare Stuff1=mesh{mesh1...}
  #declare Stuff2=mesh{mesh2...}
  #declare Color=rgb<1,0,0>;
  object{Stuff1 pigment{Color}}
  object{Stuff2 pigment{Color} normal { bumps 1 scale 25*0.02 }}

Have fun!


Post a reply to this message

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