POV-Ray : Newsgroups : povray.programming : Passing custom key presses to a POV scene? Server Time
19 Apr 2024 19:39:08 EDT (-0400)
  Passing custom key presses to a POV scene? (Message 12 to 21 of 21)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: stbenge
Subject: Re: Passing custom key presses to a POV scene?
Date: 17 Oct 2009 16:29:24
Message: <4ada2924@news.povray.org>
clipka wrote:
> You might do it as follows:

I'll give this a go soon. Thank you for replying!


Post a reply to this message

From: stbenge
Subject: Re: Passing custom key presses to a POV scene?
Date: 17 Oct 2009 16:34:08
Message: <4ada2a40$1@news.povray.org>
Christian Froeschlin wrote:
> stbenge wrote:
> 
>> I'm having to use +kff1215752192, which should be enough time for 
>> solving the maze.
> 
> ah, I think you didn't mention before that you were running
> povray in a continuous animation loop. Now I see how you are
> trying to do it. I was assuming you executed povray once for
> each new frame, in which case you could have used command
> line parameter (but probably end up with a lot less fps).

I wish I knew how to execute POV-Ray from the command line. I know how 
to use the command line, but I cannot seem to get my program to find 
POV. Simply typing system("start pvengine etc..."); won't work. I get a 
message telling me that 'pvengine' was not found :( 'pvengine.exe' also 
does not work. I spent hours looking up a way to find the path of an 
.exe by name alone, but got nowhere at all.

> In your case you indeed need a form of synchronization mechanism
> and clipkas suggestion should work for that. If the time you need
> to write to the inc file is significantly less than the time you
> need to render one frame, you can simplify it to writing a marker
> file "parse_finished" at the end of the scene, having the C++
> program wait for the appearance of that file, write the inc
> and remove the marker file.

Another good suggestion! I'll have to implement it soon. Thanks!


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Passing custom key presses to a POV scene?
Date: 18 Oct 2009 08:36:44
Message: <4adb0bdc$1@news.povray.org>
stbenge wrote:

> I wish I knew how to execute POV-Ray from the command line. I know how 
> to use the command line, but I cannot seem to get my program to find 
> POV. Simply typing system("start pvengine etc..."); won't work. I get a 
> message telling me that 'pvengine' was not found :( 'pvengine.exe' also 
> does not work. I spent hours looking up a way to find the path of an 
> .exe by name alone, but got nowhere at all.

I am a bit confused by that but I hope you're the confused one ;)

I assume you are using Windows because otherwise you'd know how
to run povray from the command line. But under Windows, pvengine.exe
is just the name of the normal povray main GUI you start every day
(note: for 3.7 beta it can be something like pvengine-sse2.exe).

You should know where it is because you installed it there :-P
but if you don't know check the link on your desktop or start
menu you use to start povray (right-click > Properties ...
will show you the full target path and name).

It will typically look something like:

   "C:\Program Files\POV-Ray for Windows v3.6\bin\pvengine.exe"

In order to start it from the command line, you need to either

A) Switch to the correct drive and directory before executing, e.g.,

    1.> C:
    2.> cd "\Program Files\POV-Ray for Windows v3.6\bin"
    3.> pvengine

    (use of double quotes is required for names which contain spaces).

B) Or, provide the full path to the executable every time

    1.> "C:\Program Files\POV-Ray for Windows v3.6\bin\pvengine"

C) Or, add the bin directory to the environment search path:

    1.> set PATH="%PATH%;C:\Program Files\POV-Ray for Windows v3.6\bin"
    2.> pvengine

    1. will only affect the current cmd shell. You can set this globally
    and permanently in the Windows GUI via

      Start Menu > Settings > Control Panel > System >
        Advanced > Environment Variables > Path

    You only add the directory there, without %PATH%.

    If you have administrator privileges, you can modify the
    System Path but be careful not to delete something else or
    corrupt it. This will work for all users. If you add it to
    the User space it will only work for the current user (add
    a new variable Path there it if doesn't yet exist).

Now practise all three methods using cmd.exe before attempting
to spawn povray from your C++ application ;) And don't forget to
play with adding command line parameters!

When you're sick of typing the same stuff over and over again,
it will be time for Lesson Two, Batch File Programming ;)


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Passing custom key presses to a POV scene?
Date: 18 Oct 2009 08:43:45
Message: <4adb0d81$1@news.povray.org>
Christian Froeschlin wrote:

> Now practise all three methods using cmd.exe before attempting
> to spawn povray from your C++ application ;)

I belatedly realized you have the problem only from your C++
application. But the steps there should be identical. The easiest
method is probably (C), a simple system("pvengine.exe") should
work after the PATH variable has been set globally, and it
does not require you to hardcode the path into your app.


Post a reply to this message

From: stbenge
Subject: Re: Passing custom key presses to a POV scene?
Date: 18 Oct 2009 16:54:57
Message: <4adb80a1$1@news.povray.org>
Christian Froeschlin wrote:
> Christian Froeschlin wrote:
> 
>> Now practise all three methods using cmd.exe before attempting
>> to spawn povray from your C++ application ;)
> 
> I belatedly realized you have the problem only from your C++
> application. But the steps there should be identical. The easiest
> method is probably (C), a simple system("pvengine.exe") should
> work after the PATH variable has been set globally, and it
> does not require you to hardcode the path into your app.

But I would want something like this to work for everybody who downloads 
my program. I wouldn't want them to have to set up environment variables 
just for my program. With POV's default behavior of installing to 
personal user directories these days, the whole issue just becomes more 
tangled. I might be missing something though...


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: Passing custom key presses to a POV scene?
Date: 18 Oct 2009 20:08:02
Message: <4adbade1@news.povray.org>
stbenge wrote:
> Christian Froeschlin wrote:
>> Christian Froeschlin wrote:
>> 
>>> Now practise all three methods using cmd.exe before attempting
>>> to spawn povray from your C++ application ;)
>> 
>> I belatedly realized you have the problem only from your C++
>> application. But the steps there should be identical. The easiest
>> method is probably (C), a simple system("pvengine.exe") should
>> work after the PATH variable has been set globally, and it
>> does not require you to hardcode the path into your app.
> 
> But I would want something like this to work for everybody who downloads
> my program. I wouldn't want them to have to set up environment variables
> just for my program. With POV's default behavior of installing to
> personal user directories these days, the whole issue just becomes more
> tangled. I might be missing something though...

It's possible POV-Ray installer stores its installation location in the
registry. You'd have to look there.


Post a reply to this message

From: stbenge
Subject: Re: Passing custom key presses to a POV scene?
Date: 18 Oct 2009 20:44:56
Message: <4adbb688@news.povray.org>
Nicolas Alvarez wrote:
> It's possible POV-Ray installer stores its installation location in the
> registry. You'd have to look there.

Every clue is good! I'll take a look and see what my options are. 
Writing .inc files every time a new key is pressed seems like the hard 
way to go about it :/


Post a reply to this message

From: William Pokorny
Subject: Re: Passing custom key presses to a POV scene?
Date: 18 Oct 2009 21:20:01
Message: <web.4adbbe42e3b9d63c331f34c90@news.povray.org>
Sam, Your idea has been rattling around in my head (plenty of space), and I
started to wonder if we might be able to do some interactive modeling with
POVRay in addition to game playing? Would be limited I expect, but such a
technique might be useful.
Bill

stbenge <not### [at] hotmailcom> wrote:
> Nicolas Alvarez wrote:
> > It's possible POV-Ray installer stores its installation location in the
> > registry. You'd have to look there.
>
> Every clue is good! I'll take a look and see what my options are.
> Writing .inc files every time a new key is pressed seems like the hard
> way to go about it :/


Post a reply to this message

From: stbenge
Subject: Re: Passing custom key presses to a POV scene?
Date: 18 Oct 2009 21:47:00
Message: <4adbc514@news.povray.org>
William Pokorny wrote:
> Sam, Your idea has been rattling around in my head (plenty of space), and I
> started to wonder if we might be able to do some interactive modeling with
> POVRay in addition to game playing? Would be limited I expect, but such a
> technique might be useful.

It's possible, all right. It sounds like a coding nightmare, but it may 
have its uses. Like if you wanted to see how an object would effect 
lighting conditions or texturing. Also, a scene viewer could be made, 
where you can interactively zoom, move through, and pan across the image.

Sam


Post a reply to this message

From: clipka
Subject: Re: Passing custom key presses to a POV scene?
Date: 19 Oct 2009 03:17:01
Message: <4adc126d$1@news.povray.org>
stbenge schrieb:

> But I would want something like this to work for everybody who downloads 
> my program. I wouldn't want them to have to set up environment variables 
> just for my program. With POV's default behavior of installing to 
> personal user directories these days, the whole issue just becomes more 
> tangled. I might be missing something though...

Try registry keys

   HKCU\Software\POV-Ray\CurrentVersion\Home
   HKCU\Software\POV-Ray\v3.6\Windows\Home
   HKCU\Software\POV-Ray\v3.7\Windows\Home


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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