POV-Ray : Newsgroups : povray.macintosh : Is there any way to make a custom pattern? Server Time
16 Jun 2024 06:40:13 EDT (-0400)
  Is there any way to make a custom pattern? (Message 3 to 12 of 12)  
<<< Previous 2 Messages Goto Initial 10 Messages
From: Chris Huff
Subject: Re: Is there any way to make a custom pattern?
Date: 23 Mar 2001 10:25:31
Message: <chrishuff-0636E2.10190623032001@news.povray.org>
In article <3ABA191B.A47B8A97@mail.rit.edu>, John Chatham 
<Wyv### [at] mailritedu> wrote:

> I've been using crackle to make randomly placed armor plates, but I also
> need to have one plate in a specific location, and have it not overlap
> any of the random plates.  What I'd like to do is something like this:
> #macro my_pattern (V)
> max( crackle (V), spherical (V) )
> #end
> #declare my_texture = texture{ my_pattern texture_map{...}}
> Is there any way to do something like this?

Using MegaPOV, it's easy...just use a function pattern.

#macro MyPattern()
    #local Crackle =
    function {
        pigment {crackle color_map {[0 rgb 0][1 rgb 1]}}
    }
    function {
        max(Crackle(x, y, z), max(0, 1-sqrt(sqr(x) + sqr(y) + sqr(z)))
    }
#end

#declare MyTexture = texture {MyPattern() texture_map{...}}

You could also declare a spherical pigment function and use that instead 
of "max(0, 1-sqrt(sqr(x) + sqr(y) + sqr(z))", but it wouldn't be as 
flexible, and might be slower. Or it might be faster...
MacMegaPOV is available here:
http://users.skynet.be/smellenbergh/

BTW, it's a good idea to always use at least one capital letter in 
variable/macro names, to avoid interference from a keyword in a future 
version. Keywords will always be lower-case, so it's easy to avoid name 
collisions.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Lazarus Plath
Subject: Setting animation parameters in file
Date: 17 Apr 2001 06:21:04
Message: <B7016789.5720%lazarusp@earthlink.net>
I've made a program that creates POV scenes and I'd like to make animations.
I can't really use the clock to modify my model so I generate an include
file for each frame and create animations like this:

# if (clock = 1)
#include frame01.inc
#end

#if (clock = 2)
#include frame02.inc
#end
etc....

The problem is that I want to completely automate the process; generate all
the files, open the animation file, then render; but I've been unable to
specify the clock and frame variables. I have to open the render settings
window and manually set the values under the animation tab. Is there a way
to set this up in the file (the initial_clock, final_clock, initial_frame,
final_frame variables)? In the documentation I read about INI files where
you can specify these things, but I've been unable to get POV to recognize
the INI. How do I use an INI?

Also, is there anyway to have POV automatically render? I havnt seen
anything about applescript. In my program I press a button and the scene
file is created and opened in POV automatically, then I have to go to all
the trouble of pressing command-R ;) Any way to skip that last step?

This newbie appreciates all suggestions

-laz


Post a reply to this message

From: David
Subject: Re: Setting animation parameters in file
Date: 17 Apr 2001 13:28:22
Message: <B701CB47.5BED%mccabesoftware@yahoo.com>
I think you can use the 'print' AppleScript command to render an image.

POV-Ray really needs more OSA support, IMHO.
______
David McCabe
dav### [at] maccom
http://homepage.mac.com/davidmccabe/
Jesus loves you!
 
> I've made a program that creates POV scenes and I'd like to make animations.
> I can't really use the clock to modify my model so I generate an include
> file for each frame and create animations like this:
> 
> # if (clock = 1)
> #include frame01.inc
> #end
> 
> #if (clock = 2)
> #include frame02.inc
> #end
> etc....
> 
> The problem is that I want to completely automate the process; generate all
> the files, open the animation file, then render; but I've been unable to
> specify the clock and frame variables. I have to open the render settings
> window and manually set the values under the animation tab. Is there a way
> to set this up in the file (the initial_clock, final_clock, initial_frame,
> final_frame variables)? In the documentation I read about INI files where
> you can specify these things, but I've been unable to get POV to recognize
> the INI. How do I use an INI?
> 
> Also, is there anyway to have POV automatically render? I havnt seen
> anything about applescript. In my program I press a button and the scene
> file is created and opened in POV automatically, then I have to go to all
> the trouble of pressing command-R ;) Any way to skip that last step?
> 
> This newbie appreciates all suggestions
> 
> -laz
>


Post a reply to this message

From: Josh English
Subject: Re: Setting animation parameters in file
Date: 18 Apr 2001 01:14:35
Message: <3ADD21E4.1A5D08CB@spiritone.com>
Lazarus Plath wrote:

> I've made a program that creates POV scenes and I'd like to make animations.
> I can't really use the clock to modify my model so I generate an include
> file for each frame and create animations like this:
>
> # if (clock = 1)
> #include frame01.inc
> #end
>
> #if (clock = 2)
> #include frame02.inc
> #end
> etc....

You can probably simplify this with a string concatenation:

#declare thisfile = concat("frame"+str(clock,2,2) + ".inc)
#include thisfile

Of course you if you use MegaPov you can use the framenumber keyword as well.
If you explain some of the details about the project we can help you streamline
the animation process. The clock keyword is actually pretty powerful and
flexible.

> The problem is that I want to completely automate the process; generate all
> the files, open the animation file, then render; but I've been unable to
> specify the clock and frame variables. I have to open the render settings
> window and manually set the values under the animation tab. Is there a way
> to set this up in the file (the initial_clock, final_clock, initial_frame,
> final_frame variables)? In the documentation I read about INI files where
> you can specify these things, but I've been unable to get POV to recognize
> the INI. How do I use an INI?

In the Render Settings dialog box, on the scene tab there is a check mark for
Read INI . If your main text file is "foo.pov" then it will look for "foo.ini"

You can also open an ini file and there is a switch for a source file and when
you render the INI file, it grabs the source. I haven't played with that too
much however.


> Also, is there anyway to have POV automatically render? I havnt seen
> anything about applescript. In my program I press a button and the scene
> file is created and opened in POV automatically, then I have to go to all
> the trouble of pressing command-R ;) Any way to skip that last step?

I'm not sure what you mean by this. POV-Ray does not automatically Render on
the Mac.

Josh English
eng### [at] spiritonecom


Post a reply to this message

From: Lazarus Plath
Subject: Re: Setting animation parameters in file
Date: 18 Apr 2001 04:54:28
Message: <B702A4BD.62AE%lazarusp@earthlink.net>
Josh English wrote...

> Lazarus Plath wrote:
> 
>> I've made a program that creates POV scenes and I'd like to make animations.
>> I can't really use the clock to modify my model so I generate an include
>> file for each frame and create animations like this:
>> 
>> # if (clock = 1)
>> #include frame01.inc
>> #end
>> 
>> #if (clock = 2)
>> #include frame02.inc
>> #end
>> etc....
> 
> You can probably simplify this with a string concatenation:
> 
> #declare thisfile = concat("frame"+str(clock,2,2) + ".inc)
> #include thisfile

This is very cool! I've been using POV for about a week now and didn't know
you can do things like this.

> Of course you if you use MegaPov you can use the framenumber keyword as well.

I've just downloaded MegaPOV and havn't had a chance to look at it.

> If you explain some of the details about the project we can help you
> streamline
> the animation process. The clock keyword is actually pretty powerful and
> flexible.

The program I've created uses splines and other methods of moving and
distorting objects. I know there is basically a complete math interpreter so
I could conceivably put all this in the POV file, but I find it easier to
create a different model for each frame.

>> final_frame variables)? In the documentation I read about INI files where
>> you can specify these things, but I've been unable to get POV to recognize
>> the INI. How do I use an INI?
> 
> In the Render Settings dialog box, on the scene tab there is a check mark for
> Read INI . If your main text file is "foo.pov" then it will look for "foo.ini"

Perfect. I just checked the Read INI file check box and have been fiddling
around with things. Now it's reading the .ini I make, there's some more
things I need to setup, but its working now.

> You can also open an ini file and there is a switch for a source file and when
> you render the INI file, it grabs the source. I haven't played with that too
> much however.

I'll have to look into this, I think it may be better.

> 
>> Also, is there anyway to have POV automatically render? I havnt seen
>> anything about applescript. In my program I press a button and the scene
>> file is created and opened in POV automatically, then I have to go to all
>> the trouble of pressing command-R ;) Any way to skip that last step?
> 
> I'm not sure what you mean by this. POV-Ray does not automatically Render on
> the Mac.

The program I'm working on is an extension of a 2D program I've made, where
I did all the rendering in the program itself. When I decided to try some 3D
stuff I started making a raytracer and made a simple little thing. But when
I saw how simple it was to generate a POV file and how much better it
rendered I'm setting it up so I do all the modeling in my program then
render in POV. In my program I have a menu item "Auto POV" (command-A) which
creates my scene file and automatically opens it in POV. Then I press
command-R to render. Go back to my program, change some stuff then
command-A, command-R. I'd like to just have a button I can click that will
create the scene open it and render.

David, (a previous poster) says there's an applescript command 'print' that
with cause a render, but I dont see that in POV's applescript dictionary (I
dont see anything in its dictionary). Maybe thats for MegaPOV, I need to
look into Mega, sounds like it does alot more.

> Josh English
> eng### [at] spiritonecom
>

Thanks very much

-laz


Post a reply to this message

From: RJay Hansen
Subject: Re: Setting animation parameters in file
Date: 18 Apr 2001 08:42:53
Message: <rhansen-A193DA.06392918042001@povray.org>
In article <B702A4BD.62AE%laz### [at] earthlinknet>,
 Lazarus Plath <laz### [at] earthlinknet> wrote:

> David, (a previous poster) says there's an applescript command 'print' that
> with cause a render, but I dont see that in POV's applescript dictionary (I
> dont see anything in its dictionary). Maybe thats for MegaPOV, I need to
> look into Mega, sounds like it does alot more.

Example Applescript from the official Mac distribution--

-- Simple example of using POV-Ray's hidden batch-scripting feature
-- Using the Finder "print" AppleScript
--
tell application "Finder"
   -- Start up the POV-Ray application.
   -- NOTE: Only do this if it isn't already running
   -- run application "POV-Ray PPC"
   --
   -- Loop through all ".pov" files on top level of your HD
   --
   set fileList to every file in startup disk whose name ends with ".pov"
   -- convert files to pathname string
   repeat with f in fileList
      tell application "POV-Ray PPC"
         print f
      end tell
   end repeat
end tell

I've never tried it. :-)

RJay

-- 
http://www.2540dpi.f2s.com


Post a reply to this message

From: David
Subject: Re: Setting animation parameters in file
Date: 18 Apr 2001 16:11:24
Message: <B70342FC.5BFB%mccabesoftware@yahoo.com>
Yes, I think that 'print' will render a file. Just look at the "POV Batch
Render Example" script that comes with POV-Ray.

May I ask what this program is? Is it publicly avalible?
______
David McCabe
mcc### [at] yahoocom
http://homepage.mac.com/davidmccabe/
Jesus loves you! 

> The program I'm working on is an extension of a 2D program I've made, where
> I did all the rendering in the program itself. When I decided to try some 3D
> stuff I started making a raytracer and made a simple little thing. But when
> I saw how simple it was to generate a POV file and how much better it
> rendered I'm setting it up so I do all the modeling in my program then
> render in POV. In my program I have a menu item "Auto POV" (command-A) which
> creates my scene file and automatically opens it in POV. Then I press
> command-R to render. Go back to my program, change some stuff then
> command-A, command-R. I'd like to just have a button I can click that will
> create the scene open it and render.
> 
> David, (a previous poster) says there's an applescript command 'print' that
> with cause a render, but I dont see that in POV's applescript dictionary (I
> dont see anything in its dictionary). Maybe thats for MegaPOV, I need to
> look into Mega, sounds like it does alot more.
> 
>> Josh English
>> eng### [at] spiritonecom
>> 
> 
> Thanks very much
> 
> -laz
>


Post a reply to this message

From: David
Subject: Re: Setting animation parameters in file
Date: 18 Apr 2001 16:12:46
Message: <B703434F.5BFC%mccabesoftware@yahoo.com>
I tried to make a Folder Actions version of this script, but couldn't get it
to work. Perhaps I should try it agian.
______
David McCabe
mcc### [at] yahoocom
http://homepage.mac.com/davidmccabe/
Jesus loves you! 

> 
> Example Applescript from the official Mac distribution--
> 
> -- Simple example of using POV-Ray's hidden batch-scripting feature
> -- Using the Finder "print" AppleScript
> --
> tell application "Finder"
> -- Start up the POV-Ray application.
> -- NOTE: Only do this if it isn't already running
> -- run application "POV-Ray PPC"
> --
> -- Loop through all ".pov" files on top level of your HD
> --
> set fileList to every file in startup disk whose name ends with ".pov"
> -- convert files to pathname string
> repeat with f in fileList
> tell application "POV-Ray PPC"
> print f
> end tell
> end repeat
> end tell
> 
> I've never tried it. :-)
> 
> RJay
> 
> -- 
> http://www.2540dpi.f2s.com


Post a reply to this message

From: Lazarus Plath
Subject: Re: Setting animation parameters in file
Date: 22 Apr 2001 02:54:32
Message: <B707CE90.635D%lazarusp@earthlink.net>
RJay Hansen wrote...

> Example Applescript from the official Mac distribution--
> 
> -- Simple example of using POV-Ray's hidden batch-scripting feature
> -- Using the Finder "print" AppleScript
> --

Ahhh, I found the example applescript. I took the application out of that
folder when I first got POV and havnt looked in there till now.

The only applescript info I could find in the MacOS Read Me that came with
3.1g.r2 is:

The Good News... Ideas after version 3.1
-Full AppleScript support, change rendering options & start/stop rendering
(I have added the beginnings of this into the source code.) Can't wait for
3.2, but I wish what was added was documented.

But I see what you and David are talking about with the print command. I can
select a POV file and choose File:Print from the finder and it auto renders.
But then it closes the file. I'll see if the Pause_When_Done switch can fix
this.

I've only scripted a couple, simple things before, so I'm still working on a
few parts to get this working with my program.

Thanks....    laz


Post a reply to this message

From: Lazarus Plath
Subject: Re: Setting animation parameters in file
Date: 22 Apr 2001 02:54:34
Message: <B707CE92.635D%lazarusp@earthlink.net>
David wrote...

> Yes, I think that 'print' will render a file. Just look at the "POV Batch
> Render Example" script that comes with POV-Ray.

Yes, I've been slowly figuring out the applescript.

> May I ask what this program is? Is it publicly avalible?

When I finish I'll make the program public. I need to add a few things and
make it look nicer. But its first generation. When I make a program it
usually goes in cycles where I build my idea, then as I use it I discover
new ways it can be used, so I make another program. The current version has
been usable for about 5 days now and already I've found several new ideas I
want to add. Its not as easy to make symmetrical patterns as the 2D program,
but there's some techniques I may automate into it.

Have you seen those movies of spheres placed along a 3D genetic generated
curve? I think someone from MIT made them and I've seen it on PBS. My
program doesnt do that, but its sorta similar. There's no genetic
algorithms, but you create a curve and then its rendered in POV with spheres
along the curve. So its more of the mirror balls in a raytracer, but if I
can make it easier to keep symmetry it'll be fun.

-laz


Post a reply to this message

<<< Previous 2 Messages Goto Initial 10 Messages

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