POV-Ray : Newsgroups : povray.general : Mapping Textures on irregular shapes Server Time
2 Jun 2024 05:10:55 EDT (-0400)
  Mapping Textures on irregular shapes (Message 41 to 47 of 47)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Bald Eagle
Subject: Re: Mapping Textures on irregular shapes
Date: 3 May 2020 20:15:00
Message: <web.5eaf5d7972e01857fb0b41570@news.povray.org>
"Josh" <nomail@nomail> wrote:

> 1) (How) can I overlay pigment textures? I am envisoning something like the
> following where I overlay a bozo pigment on top of an agate pigment, with
> transparency on the bozo color map... Ideally, where the bozo map is not
> transparent it would replace the pigment of the agate color map, not add to
> it...
>
> pigment
> {
>   agate
>   color_map
>   {
>     [0 Gold]
>     [1 Brown]
>   }
>   bozo
>   color_map
>   {
>     [0 Transparent]
>     [1 Red]
>   }
> }
>
Close.  Define 2 textures, each with a single pigment pattern.

Then just do
object {Object texture {texture1} texture {texture2}}
The second will overlap the first.

> 2) How can I change the seed for builtin functions that use random like agate,
> granite, bozo, f_noise3d so that they produce different results?

You don't really change the seed ---  if you envision the bozo as a volume of
swirling color values - like poorly mixed paints, or drops of dye only beginning
to diffuse in water and frozen in time, then what you do is just move your
object, or move the texture, and they overlap differently.

so just do
object {texture {OverallTexture translate <x_amt, y_amt, z_amt>}}
obviously you can rotate, scale, and apply transforms as well.

> 3) If I have 15 asteroids defined like #declare aster1 = isosurface { ...
> transform { Axis_Rotate_Trans( <1, .2, 0>, 360*clock) }}, how would I setup
> povray to iterate through them and render a seperate animation for each
> asteroid? I'm fine just writing an external program to iterate on them if
> needed, but if it's easy I'd like to see the povray way...

Pretty good question - I do believe it's possible, but I've never done it
myself.
Others surely will know.
Hopefully you get that worked out and post the process.
I'm sure it's different for M$ Win vs Linux


Post a reply to this message

From: Josh
Subject: Re: Mapping Textures on irregular shapes
Date: 3 May 2020 20:25:00
Message: <web.5eaf60a872e01857dc1270cd0@news.povray.org>
> Thanks so everyone for the advice and hints, I am well on my way now. I have a
> couple of questions not directly related to the questions that started this
> thread...
>
> 1) (How) can I overlay pigment textures? I am envisoning something like the
> following where I overlay a bozo pigment on top of an agate pigment, with
> transparency on the bozo color map... Ideally, where the bozo map is not
> transparent it would replace the pigment of the agate color map, not add to
> it...
>
> pigment
> {
>   agate
>   color_map
>   {
>     [0 Gold]
>     [1 Brown]
>   }
>   bozo
>   color_map
>   {
>     [0 Transparent]
>     [1 Red]
>   }
> }
>
> 2) How can I change the seed for builtin functions that use random like agate,
> granite, bozo, f_noise3d so that they produce different results?
>
> 3) If I have 15 asteroids defined like #declare aster1 = isosurface { ...
> transform { Axis_Rotate_Trans( <1, .2, 0>, 360*clock) }}, how would I setup
> povray to iterate through them and render a seperate animation for each
> asteroid? I'm fine just writing an external program to iterate on them if
> needed, but if it's easy I'd like to see the povray way...
>
> Thanks so much!
>
> Josh

Also,

4) I can't seem to get random numbers working. I've included #include
"functions.inc", #include "rand.inc". I have #declare Rnd_1 = seed (1153); but
when I put rand(Rnd_1) somewhere that you could put a float constant, povray
just complains that it expects something else.

Josh


Post a reply to this message

From: Bald Eagle
Subject: Re: Mapping Textures on irregular shapes
Date: 3 May 2020 20:55:00
Message: <web.5eaf673272e01857fb0b41570@news.povray.org>
"Josh" <nomail@nomail> wrote:

> Also,
>
> 4) I can't seem to get random numbers working. I've included #include
> "functions.inc", #include "rand.inc". I have #declare Rnd_1 = seed (1153); but
> when I put rand(Rnd_1) somewhere that you could put a float constant, povray
> just complains that it expects something else.

I'd need to see the actual statement that gets flagged and the actual error
message.  I don't know what that "something else" is.

I will guess that is complains that it found a ")" when it expected another
numerical argument.


Post a reply to this message

From: Josh
Subject: Re: Mapping Textures on irregular shapes
Date: 6 May 2020 15:55:01
Message: <web.5eb3155b72e01857dc1270cd0@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "Josh" <nomail@nomail> wrote:
>
> > Also,
> >
> > 4) I can't seem to get random numbers working. I've included #include
> > "functions.inc", #include "rand.inc". I have #declare Rnd_1 = seed (1153); but
> > when I put rand(Rnd_1) somewhere that you could put a float constant, povray
> > just complains that it expects something else.
>
> I'd need to see the actual statement that gets flagged and the actual error
> message.  I don't know what that "something else" is.
>
> I will guess that is complains that it found a ")" when it expected another
> numerical argument.

So here is the relevant part of my .pov file.

#declare Rnd_1 = seed (1153);

isosurface
{
  function
  {
    BASE_SHAPE(x + rand(Rnd_1), y, z)
  }
}

The exact statement minus the + rand(Rnd_1) works fine.

Here is the error:

File 'asteroid.pov' line 216: Parse Error: Expected 'function identifier', }
 found instead

Josh


Post a reply to this message

From: Josh
Subject: Re: Mapping Textures on irregular shapes
Date: 6 May 2020 16:00:01
Message: <web.5eb3165a72e01857dc1270cd0@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> Close.  Define 2 textures, each with a single pigment pattern.
>
> Then just do
> object {Object texture {texture1} texture {texture2}}
> The second will overlap the first.
>

Great, that worked!

> > 2) How can I change the seed for builtin functions that use random like agate,
> > granite, bozo, f_noise3d so that they produce different results?
>
> You don't really change the seed ---  if you envision the bozo as a volume of
> swirling color values - like poorly mixed paints, or drops of dye only beginning
> to diffuse in water and frozen in time, then what you do is just move your
> object, or move the texture, and they overlap differently.
>
> so just do
> object {texture {OverallTexture translate <x_amt, y_amt, z_amt>}}
> obviously you can rotate, scale, and apply transforms as well.

Certainly there must be a way to change the seed for f_noise3d at least to get a
different noise shape, right?

>
> > 3) If I have 15 asteroids defined like #declare aster1 = isosurface { ...
> > transform { Axis_Rotate_Trans( <1, .2, 0>, 360*clock) }}, how would I setup
> > povray to iterate through them and render a seperate animation for each
> > asteroid? I'm fine just writing an external program to iterate on them if
> > needed, but if it's easy I'd like to see the povray way...
>
> Pretty good question - I do believe it's possible, but I've never done it
> myself.
> Others surely will know.
> Hopefully you get that worked out and post the process.
> I'm sure it's different for M$ Win vs Linux

Is there a simple way to pass (commandline) parameters into Povray? If I could
pass in a single number, then I could do an if in Povray based on it and then
call Povray multiple times with different numbers to render the different
asteroids?...

Josh


Post a reply to this message

From: Josh
Subject: Re: Mapping Textures on irregular shapes
Date: 6 May 2020 16:15:01
Message: <web.5eb31a1e72e01857dc1270cd0@news.povray.org>
"Josh" <nomail@nomail> wrote:
> "Bald Eagle" <cre### [at] netscapenet> wrote:
> > Close.  Define 2 textures, each with a single pigment pattern.
> >
> > Then just do
> > object {Object texture {texture1} texture {texture2}}
> > The second will overlap the first.
> >
>
> Great, that worked!
>
> > > 2) How can I change the seed for builtin functions that use random like agate,
> > > granite, bozo, f_noise3d so that they produce different results?
> >
> > You don't really change the seed ---  if you envision the bozo as a volume of
> > swirling color values - like poorly mixed paints, or drops of dye only beginning
> > to diffuse in water and frozen in time, then what you do is just move your
> > object, or move the texture, and they overlap differently.
> >
> > so just do
> > object {texture {OverallTexture translate <x_amt, y_amt, z_amt>}}
> > obviously you can rotate, scale, and apply transforms as well.
>
> Certainly there must be a way to change the seed for f_noise3d at least to get a
> different noise shape, right?
>
> >
> > > 3) If I have 15 asteroids defined like #declare aster1 = isosurface { ...
> > > transform { Axis_Rotate_Trans( <1, .2, 0>, 360*clock) }}, how would I setup
> > > povray to iterate through them and render a seperate animation for each
> > > asteroid? I'm fine just writing an external program to iterate on them if
> > > needed, but if it's easy I'd like to see the povray way...
> >
> > Pretty good question - I do believe it's possible, but I've never done it
> > myself.
> > Others surely will know.
> > Hopefully you get that worked out and post the process.
> > I'm sure it's different for M$ Win vs Linux
>
> Is there a simple way to pass (commandline) parameters into Povray? If I could
> pass in a single number, then I could do an if in Povray based on it and then
> call Povray multiple times with different numbers to render the different
> asteroids?...

I figured out this last part. Simply put Declare=ASTEROIDNUM=2 on the
commandline to declare an identifier...

Josh


Post a reply to this message

From: Bald Eagle
Subject: Re: Mapping Textures on irregular shapes
Date: 6 May 2020 18:50:01
Message: <web.5eb33ef672e01857fb0b41570@news.povray.org>
"Josh" <nomail@nomail> wrote:

> isosurface
> {
>   function
>   {
>     BASE_SHAPE(x + rand(Rnd_1), y, z)
>   }
> }
>
> The exact statement minus the + rand(Rnd_1) works fine.
>
> Here is the error:
>
> File 'asteroid.pov' line 216: Parse Error: Expected 'function identifier', }
>  found instead
>
> Josh

You need to precompute the random number before passing it into your function.

#declare RN = rand(Rnd_1);

> isosurface
> {
>   function
>   {
>     BASE_SHAPE(x + RN, y, z)
>   }
> }

Will work.
But it will then stay the same number selected from the pseudo-random stream,
and so apply the SAME number to ALL of the x's.   You may as well just input
your own "randomly" determined number between 0 and 1.

If you want to just add some amount of noise to x - meaning a different amount
of noise depending on the x value, then you need to modify x with one of the
precomputed noise _functions_.

x + f_noise3D (x,y,z) or something like that

you might also try selecting out the x component of the noise like this:

BASE_SHAPE(f_noise3D (x,0,0), y, z)


Functions are tricky, and the syntax is fussy, and there are only certain things
you can use in functions, and only certain things that will work the way you
initially think they will - the rest are more complicated.


With regard to "changing the seed" for the noise function, I think that maybe
you can change the noise generator.
http://wiki.povray.org/content/Reference:Global_Settings#Noise_generator

But I don't really know how to change what it starts off calculating the noise
with.   I'd just use translate and rotate to change the existing noise function,
because that's largely the same thing.


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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