POV-Ray : Newsgroups : povray.programming : Passing custom key presses to a POV scene? : Re: Passing custom key presses to a POV scene? Server Time
2 May 2024 17:43:34 EDT (-0400)
  Re: Passing custom key presses to a POV scene?  
From: Christian Froeschlin
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

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