POV-Ray : Newsgroups : povray.newusers : bicubic patch editor Server Time
13 Apr 2025 08:25:18 EDT (-0400)
  bicubic patch editor (Message 21 to 30 of 38)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 8 Messages >>>
From: Bald Eagle
Subject: Re: bicubic patch editor
Date: 1 Apr 2025 14:15:00
Message: <web.67ec2c1041fe044a911b6e125979125@news.povray.org>
"gulino" <nomail@nomail> wrote:

> but I have a error in
> Grass (x, y,z)*GrassHeight}
>
> "Expected '.', * found instead"

Yeah - inbuilt pigment functions return a full rgbft vector, so you have to
specify which vector component you want to use in the crippled user-defined
scalar function you're writing.

So, just do:
Grass (x, y,z).red*GrassHeight

- BW


Post a reply to this message

From: gulino
Subject: Re: bicubic patch editor
Date: 1 Apr 2025 14:45:00
Message: <web.67ec336341fe044264ac0beab67afd2@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "gulino" <nomail@nomail> wrote:
>
> > but I have a error in
> > Grass (x, y,z)*GrassHeight}
> >
> > "Expected '.', * found instead"
>
> Yeah - inbuilt pigment functions return a full rgbft vector, so you have to
> specify which vector component you want to use in the crippled user-defined
> scalar function you're writing.
>
> So, just do:
> Grass (x, y,z).red*GrassHeight
>
> - BW


#declare PlainAndGrass = function {Plain (x, y, z, 2.3, 7.0, 5.0, -2, 1, 3.0) +
Grass (x, y,z).red*GrassHeight}

"Invalid number of parameters 9 supplied, 3 required"


Post a reply to this message

From: Bald Eagle
Subject: Re: bicubic patch editor
Date: 1 Apr 2025 15:00:00
Message: <web.67ec36cc41fe044a911b6e125979125@news.povray.org>
{sigh}
Since you're supplying the other 6 parameters as numeric values in your function
declaration, you don't need to supply them as actual parameters when you call
the function.

try:
#declare PlainAndGrass = function {Plain (x, y, z) +
Grass (x, y,z).red*GrassHeight}

If you want to keep it like it is in the final function, rewrite Plain using
(x, y, z, P0, P1, P2, P3, P4, P5) in both parentheses and curly braces.

But just try x,y, z for now.

- BW


Post a reply to this message

From: gulino
Subject: Re: bicubic patch editor
Date: 1 Apr 2025 15:25:00
Message: <web.67ec3c8c41fe044264ac0beab67afd2@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> {sigh}
> Since you're supplying the other 6 parameters as numeric values in your function
> declaration, you don't need to supply them as actual parameters when you call
> the function.
>
> try:
> #declare PlainAndGrass = function {Plain (x, y, z) +
> Grass (x, y,z).red*GrassHeight}
>
> If you want to keep it like it is in the final function, rewrite Plain using
> (x, y, z, P0, P1, P2, P3, P4, P5) in both parentheses and curly braces.
>
> But just try x,y, z for now.
>
> - BW

#declare Plain = function {f_ridged_mf(x,y,z, 2.3, 7.0, 5.0, -2, 1, 3.0) }
#declare Grass = function {pigment {bumps}
#declare GrassHeight = 10;
#declare PlainAndGrass = function {Plain (x, y, z) +
Grass (x, y,z).red*GrassHeight}

"Invalid number of parameters, 3 suplied, 8 required"
what


Post a reply to this message

From: Bald Eagle
Subject: Re: bicubic patch editor
Date: 1 Apr 2025 15:50:00
Message: <web.67ec42ff41fe0445e04e68c25979125@news.povray.org>
"gulino" <nomail@nomail> wrote:

> #declare Plain = function {f_ridged_mf(x,y,z, 2.3, 7.0, 5.0, -2, 1, 3.0) }
> #declare Grass = function {pigment {bumps}
> #declare GrassHeight = 10;
> #declare PlainAndGrass = function {Plain (x, y, z) +
> Grass (x, y,z).red*GrassHeight}
>
> "Invalid number of parameters, 3 suplied, 8 required"

Then like I said, try:

#declare Plain = function {f_ridged_mf(x,y,z, P0, P1, P2, P3, P4, P5) }
#declare Grass = function {pigment {bumps}} // <--- you need a closing curly
brace
#declare GrassHeight = 10;
#declare PlainAndGrass = function {Plain (x, y, z, 2.3, 7.0, 5.0, -2, 1, 3.0) +
Grass (x, y,z).red*GrassHeight}


Then declare Pattern = pigment {function {PlainAndGrass (x, y, z, P0, P1, P2,
P3, P4, P5)}}
(Thanks for your patience. ;) This is easier when I'm home and can provide
functional, tested code that I can run through the parser.)

- BW


Post a reply to this message

From: Bald Eagle
Subject: Re: bicubic patch editor
Date: 2 Apr 2025 06:45:00
Message: <web.67ed14ac41fe0441f9dae3025979125@news.povray.org>
I got derailed last night, but did not forget.

Tested, working code:


#version 3.8;
global_settings {
 assumed_gamma 1.0
}

#include "functions.inc"

#declare E = 0.00001;


#declare Location = <0, 500, -1000>;
camera {
 location Location
 right x*image_width/image_height
 up y
 look_at <0, 0, 0>
}


sky_sphere {pigment {rgb 1}}

light_source {<3000, 2000, -2000> rgb 1}
sky_sphere {pigment {rgb 1}}

#declare Line = 0.01;

#declare E = 0.0000001;

#declare Plain = function (x, y, z, P0, P1, P2, P3, P4, P5) {f_ridged_mf (x,y,z,
P0, P1, P2, P3, P4, P5) }
#declare Grass = function {pigment {bumps}}
#declare GrassHeight = 10;
#declare PlainAndGrass = function (x, y, z, P0, P1, P2, P3, P4, P5) {Plain (x,
y, z, P0, P1, P2, P3, P4, P5) +
Grass (x, y,z).red*GrassHeight}


height_field {
   function 1000, 2000 {PlainAndGrass (x,y,z, 2.3, 7.0, 5.0, -2, 1, 3.0) }
   smooth
    pigment {
       color rgb <0.3, 0.5, 0.0>
    }
    translate <-0.5, 0, -0.5>
    scale <1000, 100, 1300>
}


Post a reply to this message


Attachments:
Download 'landscape.png' (258 KB)

Preview of image 'landscape.png'
landscape.png


 

From: gulino
Subject: Re: bicubic patch editor
Date: 2 Apr 2025 09:40:00
Message: <web.67ed3dd841fe044264ac0beab67afd2@news.povray.org>
Thanks for the help but what exactly is this? I was aiming to make a grass
texture like this


Post a reply to this message


Attachments:
Download 'plainpov.png' (238 KB)

Preview of image 'plainpov.png'
plainpov.png


 

From: jr
Subject: Re: bicubic patch editor
Date: 2 Apr 2025 09:50:00
Message: <web.67ed403941fe044721a48e56cde94f1@news.povray.org>
hi,

"gulino" <nomail@nomail> wrote:
> Thanks for the help but what exactly is this? I was aiming to make a grass
> texture like this

individual grass blades (meshes) "planted" is one option, if you search for
"grass macro" or variations on this site, there'll be plenty of "hits", some
going back _years_ :-).  see for instance this thread:
<https://news.povray.org/povray.binaries.images/thread/%3C46972e23%40news.povray.org%3E/>.
 hth.


regards, jr.


Post a reply to this message

From: Bald Eagle
Subject: Re: bicubic patch editor
Date: 2 Apr 2025 10:05:00
Message: <web.67ed434141fe04425b4de9225979125@news.povray.org>
"gulino" <nomail@nomail> wrote:
> Thanks for the help but what exactly is this? I was aiming to make a grass
> texture like this

I'm just getting the functions to work without any errors.
Scale the functions so that they make something along the lines of what you
want.

Do that by multiplying or dividing the x, y, and z in the function call.

You may find Mike Williams' isosurface tutorial helpful with regard to working
with functions in POV-Ray.
https://wiki.povray.org/content/User:BillW

Also, as jr said, if you can't get the function or the normal method to work,
then you can use a set of macros to model actual blades of grass to better give
you what you're looking for.

Also, like jr said, you have 30 years of people writing and posting scenes here.
Search for "grass", "landscape", "heightfield", etc and see what pops up.
Use the website search feature, but also use a search engine to see what people
have done and have posted elsewhere.



- BW


Post a reply to this message

From: gulino
Subject: Re: bicubic patch editor
Date: 2 Apr 2025 11:25:00
Message: <web.67ed55bb41fe044264ac0beab67afd2@news.povray.org>
What you think? Looks grass?


Post a reply to this message


Attachments:
Download 'plainpov (2).png' (108 KB)

Preview of image 'plainpov (2).png'
plainpov (2).png


 

<<< Previous 10 Messages Goto Latest 10 Messages Next 8 Messages >>>

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