POV-Ray : Newsgroups : povray.binaries.images : object_pattern fun Server Time
26 Apr 2024 07:19:50 EDT (-0400)
  object_pattern fun (Message 11 to 15 of 15)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Thomas de Groot
Subject: Re: object_pattern fun
Date: 18 Oct 2019 07:36:55
Message: <5da9a3d7$1@news.povray.org>
Op 17/10/2019 om 08:21 schreef Thomas de Groot:
> Op 16/10/2019 om 19:46 schreef Bald Eagle:
>> I made some signs for a W that's still IP, maybe you can play with the 
>> code and
>> see about expanding on it for your own purposes.
>>
> 
> Mmm... I have to investigate this. At first glance, you seem to be doing 
> what I failed to do one way or another. Thanks!
> 

Right. I clarified things for myself. I obviously made a bit of a mess 
of my code. ;-)

So, the layering of the following two textures /is/ possible:

//------------------------------------------
#local T_Rose1 =
texture {
   pigment {
     object {Rose1
       rgbt <1, 1, 1, 1>   // outside object
       rgb <1, 1, 0>       // inside object
     }
   }
   normal {ripples 2.0 scale 0.1}
   finish {diffuse 0.8 specular 0.25 roughness 0.001}
}

#local T_Rose2 =
texture {
   pigment {
     object {Rose2
       rgbt <1, 1, 1, 1>   // outside object
       rgb <0, 1, 0>       // inside object
     }
   }
   normal {granite 2.0}
   finish {diffuse 0.8 specular 0.25 roughness 0.001}
}
//------------------------------------------

The layering of the following two textures /is not/ possible because 
they are patterned:

//------------------------------------------
#local T_Rose1_alt =
texture {
   object {Rose1
     texture {pigment {rgbt <1, 1, 1, 1>}}   // outside object
     texture {pigment {P_star1}}             // inside object
   }
}

#local T_Rose2_alt =
texture {
   object {Rose2
     texture {pigment {rgbt <1, 1, 1, 1>}}   // outside object
     texture {pigment {P_star2}}             // inside object
   }
}
//------------------------------------------

Individually however, they can be used.

-- 
Thomas


Post a reply to this message

From: Thomas de Groot
Subject: Re: object_pattern fun
Date: 21 Oct 2019 07:17:49
Message: <5dad93dd@news.povray.org>
For those interested, I have investigated some  layered textures making 
use - one way or another - of object patterns, over a basic brown texture.

1 - Upper left: one single texture with an object_pattern;
2 - Upper right: two layered textures, each with a different object_pattern;
3 - Lower left: using a pigment_pattern to control two different 
object_patterns;
4 - Lower right: two layered textures, each with a pigment_pattern 
controlling an object_pattern.

2 and 4 have identical results, but 2 is simpler and more comprehensive 
in use. I guess that a large number of different texture possibilities 
can be derived from these examples.

I shall put the scene file in p.b.scene-files.

-- 
Thomas


Post a reply to this message


Attachments:
Download 'object_pattern_var_test.png' (366 KB)

Preview of image 'object_pattern_var_test.png'
object_pattern_var_test.png


 

From: Paolo Gibellini
Subject: Re: object_pattern fun
Date: 21 Oct 2019 11:58:01
Message: <5dadd589$1@news.povray.org>
Thomas de Groot wrote on 21/10/2019 13:17:
> For those interested, I have investigated some  layered textures making 
> use - one way or another - of object patterns, over a basic brown texture.
> 
> 1 - Upper left: one single texture with an object_pattern;
> 2 - Upper right: two layered textures, each with a different 
> object_pattern;
> 3 - Lower left: using a pigment_pattern to control two different 
> object_patterns;
> 4 - Lower right: two layered textures, each with a pigment_pattern 
> controlling an object_pattern.
> 
> 2 and 4 have identical results, but 2 is simpler and more comprehensive 
> in use. I guess that a large number of different texture possibilities 
> can be derived from these examples.
> 
> I shall put the scene file in p.b.scene-files.
> 
Nice results!
Paolo


Post a reply to this message

From: Bald Eagle
Subject: Re: object_pattern fun
Date: 24 Oct 2019 19:10:00
Message: <web.5db22e5fa64722ab4eec112d0@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:

> #macro LetterSign (_Letter, _Color)

blah blah blah...



I was sifting through all the code in my head, and wanted to do some marking of
the surface of my newly made prism thing.
Indenting the surface with a difference had its merits, but I wanted good
visibility without changing the geometry.

So I thought that using the objects in an object pattern would be cool - but
make it so that they went all the way through from one side to the other.

Based upon my past lessons and experiments with functions, and the excellent
advice of Mr. Pokorny, I figured I could plug the object pattern into a
function, and use that as a pigment - but scale it infinitely along one axis.

A further experiment - just jotting this down here for the future - would be to
do an intersection of 3 such orthogonal patterns, probably via an isosurface, to
get an "object" like you might cut out of a block of wood marked on 3 faces -
for further processing.   Perhaps add in some of that smoothing that I worked
on...


Anyway, here's a scene showing the infinitely scaled object pattern, to produce
a silhouette.

The view is from the top, of horizontal slices, and then the sides are 2 boxes
sliced through x-y and rotated to face up, showing the effect.



#version 3.8;

global_settings {
 assumed_gamma 1.0
}

#include "colors.inc"

#declare Aspect = image_width/image_height;
camera {
 location <0.9, 15, -0.1>
 right x*Aspect
 look_at <0.9, 0, 0>
}

light_source {<40, 10, -5> color White}
plane {y, -3 pigment {White}}

#declare Object =
pigment {
 object {
  sphere { <0,0,0>, 0.5 }
  color rgb <1, 0, 0>,
  color rgb <0, 1, 0>
 }
}

// Make a 2-unit box patterned with the
#declare Box = box {-1, 1 }

#declare S = 0.1;
#declare Slice = box {<-1, 0, -1> <1, -S, 1>}

#for (M, -0.3, 0.3, S)
 intersection {
  object {Slice translate y*4*M}
  object {Box}
  texture {
   pigment {Object}
   normal {agate 0.1 scale 0.0001}
   finish {specular 0.1}
  }
  translate z*3
  translate x*M*21
  no_shadow
 }
#end

difference {
 object {Box pigment {Object}}
 box {<-3, -3, -3>, <3, 3, 0>}
 cutaway_textures
 rotate x*90
 translate <-8, 0, 3>
 no_shadow
}

#declare F_Object = function {pigment {Object}}

#for (M, -0.3, 0.3, S)
 intersection {
  object {Slice translate y*4*M}
  object {Box}
  texture {
   // give function pigment an infinite y scaling
   pigment {function {F_Object (x, 0, z).red}
    color_map {
     [0.0  rgb <1, 0, 0>]
     [1.0  rgb <0, 1, 0>]
    }
   }
   normal {agate 0.1 scale 0.0001}
   finish {specular 0.1}
  }
  translate -z*1
  translate x*M*21
  no_shadow
 }
#end

difference {
 box {<-1, -5, -1>, <1, 5, 1>
 pigment {function {F_Object (x, 0, z).red}
    color_map {
     [0.0  rgb <1, 0, 0>]
     [1.0  rgb <0, 1, 0>]
    }
   }
  }
 box {<-3, -6, -3>, <3, 6, 0>}
 cutaway_textures
 rotate x*90
 translate <8, 0, 0>
 no_shadow
}


Post a reply to this message


Attachments:
Download 'objectsilhouette.png' (200 KB)

Preview of image 'objectsilhouette.png'
objectsilhouette.png


 

From: Thomas de Groot
Subject: Re: object_pattern fun
Date: 25 Oct 2019 03:09:18
Message: <5db29f9e@news.povray.org>
Op 25/10/2019 om 01:06 schreef Bald Eagle:
> "Bald Eagle" <cre### [at] netscapenet> wrote:
> 
>> #macro LetterSign (_Letter, _Color)
> 
> blah blah blah...
> 
> 
> 
> I was sifting through all the code in my head, and wanted to do some marking of
> the surface of my newly made prism thing.
> Indenting the surface with a difference had its merits, but I wanted good
> visibility without changing the geometry.
> 
> So I thought that using the objects in an object pattern would be cool - but
> make it so that they went all the way through from one side to the other.
> 
> Based upon my past lessons and experiments with functions, and the excellent
> advice of Mr. Pokorny, I figured I could plug the object pattern into a
> function, and use that as a pigment - but scale it infinitely along one axis.
> 

Yes, that should be the way to do it. Using CSG objects, like I did, in 
their simplest form, result of course in different "cut outs" related to 
their position in space.

> A further experiment - just jotting this down here for the future - would be to
> do an intersection of 3 such orthogonal patterns, probably via an isosurface, to
> get an "object" like you might cut out of a block of wood marked on 3 faces -
> for further processing.   Perhaps add in some of that smoothing that I worked
> on...
> 

Yes.

> 
> Anyway, here's a scene showing the infinitely scaled object pattern, to produce
> a silhouette.
> 
> The view is from the top, of horizontal slices, and then the sides are 2 boxes
> sliced through x-y and rotated to face up, showing the effect.
> 
[snip]
Yes.

-- 
Thomas


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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