POV-Ray : Newsgroups : povray.general : Make an Inc file Server Time
2 Aug 2024 12:19:42 EDT (-0400)
  Make an Inc file (Message 1 to 3 of 3)  
From: wapper20@hotmail com
Subject: Make an Inc file
Date: 4 Nov 2004 08:05:00
Message: <web.418a28482be6cd9675e0e1cf0@news.povray.org>
Hello,

The code below just makes a simple camera, light and box.
-code-
#include "colors.inc"
camera {
location <0, 1, -5>
look_at <0,0,0>
}
light_source {
<0, 2, -5>
color White
}
box {
<-0.5, -0.5, 0.5>,
< 0.5, 0.5,  -0.5>
pigment {
color Red
}
}
-code-

But I would like the box to be an inc file and then call it in the code
like this:

-code-
#include "box.inc"
object{ box }
-/code-

How can I do this?


Post a reply to this message

From: Alain
Subject: Re: Make an Inc file
Date: 4 Nov 2004 08:24:00
Message: <418a2d70$1@news.povray.org>
wap### [at] hotmailcom nous apporta ses lumieres ainsi en ce 2004-11-04 
08:02... :

>Hello,
>
>The code below just makes a simple camera, light and box.
>-code-
>#include "colors.inc"
>camera {
>location <0, 1, -5>
>look_at <0,0,0>
>}
>light_source {
><0, 2, -5>
>color White
>}
>box {
><-0.5, -0.5, 0.5>,
>< 0.5, 0.5,  -0.5>
>pigment {
>color Red
>}
>}
>-code-
>
>But I would like the box to be an inc file and then call it in the code
>like this:
>
>-code-
>#include "box.inc"
>object{ box }
>-/code-
>
>How can I do this?
>  
>
//begin
#declare Box=box{-1,1}
//or using a macro
#macro MacroBox(TopLeft,BotRight,Rot,Pos,Material) box{TopLeft, BotRight 
material{Material}rotate Rot translate Pos} #end
//end of file

In the first case, you need to scale,rotate, translate and add the 
pigment/texture/material you want in object{Box ...}
In the second case you need to call the macro with the parameters you 
need. Material include the pigment, finish and optionaly an interior 
that can include a media.

Alain


Post a reply to this message

From: Mark Ulrich
Subject: Re: Make an Inc file
Date: 4 Nov 2004 15:50:01
Message: <web.418a9543cdbd642aa3009e2a0@news.povray.org>
"wap### [at] hotmailcom" <wap### [at] hotmailcom> wrote:

> But I would like the box to be an inc file and then call it in the code
> like this:
>
> -code-
> #include "box.inc"
> object{ box }
> -/code-
>
> How can I do this?

Hi,

#declare mytest =
union {
#include "temp/object0.pov"
}

object {
 mytest
 rotate    < 0    , 0    , 0    >
 translate < 0    , 0    , 0    >
 scale     < 1    , 1    , 1    >
}

This throws out a warning, because the union consists of just 1 object, but
it renders.
I have to search in the documentation for the correct way, if you find
something before me, please post your result :)

Greets, Mark


Post a reply to this message

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