|
|
How to start PovRay from a 3d-application coded with Pascal (Delphi)
1. set appropriate PovRay preferences
-------------------------------------
- Menu: Editor / Auto-Reload / * Always
- Menu: Options / * Keep single instance
- add '+FN' to command line option field to save PNG pictures
2. export a 3d-scenery as PovRay file
-------------------------------------
- build filename: povfilename = <name> + '.pov'
- save scenery as ASCII file named 'povfilename'
3. get PovRay execution path from registry
------------------------------------------
- get execution command from registry
povStartCommand := GetRegistryString (HKEY_CLASSES_ROOT
, '\Applications\pvengine.exe\shell\open\Command', '');
- from povStartCommand cut away the text after 'pvengine.exe'
4. start PovRay with saved PovRay file
--------------------------------------
- set execution parameter to:
param := ' /EDIT ' + povfilename + ' /RENDER ' + povfilename;
- start povray without waiting for ending
errorCode := ShellExecute (Application.Handle, 'open'
,PChar(povStartCommand), PChar(param), nil, SW_SHOWNORMAL);
5. handling PovRay after execution
----------------------------------
- if you want to restart rendering press 'Stop' at PovRay
and continue with point 2
- to change resolution press 'Stop' change it and press 'Run'
- if rendering ends you can restart rendering
during PovRay is still running
Post a reply to this message
|
|