POV-Ray : Newsgroups : povray.general : How to include a pov ray file as an object? : Re: How to include a pov ray file as an object? Server Time
7 May 2024 20:01:26 EDT (-0400)
  Re: How to include a pov ray file as an object?  
From: kurtz le pirate
Date: 25 Jul 2018 13:38:54
Message: <5b58b5ae$1@news.povray.org>
Le 25/07/2018 à 18:40, Kima a écrit :
> I have a standalone povray file, but I want to include it as an object in my own
> povray file including other objects. I remove the camera and light from the
> first povray file and tried to include it in my own file as
> 
> 
> 
> camera {location <0,7,-7> look_at <0,0,0>}
> light_source {<-15,10,-15> color rgb<1,1,1>  }
> background {color rgb<.7,.7,.7> }
> 
> #declare externalobject = #include "/.../external.pov"
> 
> object {externalobject .... }
> 
> 
> but it doesn't work and I doesn't return any error to find out what is the
> problem.
> 

First, look the doc 
<http://www.povray.org/documentation/view/3.6.1/220/>, 2.1.2.5.3 Include 
File Name.

_"POV-Ray looks for files in the current directory. If it does not find 
a file it needs it looks in various other library directories which you 
specify. POV-Ray does not search your operating system path. It only 
searches the current directory and directories which you specify with 
this option. For example the standard include files are usually kept in 
one special directory. You tell POV-Ray to look there with..."_

Second, in your included file contain the definition of an object like :
	#declare myObject = {...}

When you add #include "path_to_file", 'myObject' is available directly 
and you can use it like :

object {
	myObject
	pigment { ... }
	finish { ... }
	transform { ... }
	...
	}


-- 
Kurtz le pirate
Compagnie de la Banquise


Post a reply to this message

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