POV-Ray : Newsgroups : povray.newusers : Syntax Help Server Time
29 Jul 2024 06:29:13 EDT (-0400)
  Syntax Help (Message 1 to 3 of 3)  
From: Woody
Subject: Syntax Help
Date: 27 Mar 2006 21:50:00
Message: <web.4428a36abebcaab06860048b0@news.povray.org>
I need help with an include file I'm writing. I'm getting an error depending
on where I place an object statement in the include file.

The file rubik.pov reads

#include "colors.inc"
#include "rubik.inc"

camera {
   location <-2, 4, -3>
   look_at <1.5,1.5,1.5>
}

light_source {
 <-2,4,-3>
 color White
 adaptive 1
 jitter
 spotlight
 radius 10
 falloff 20
 tightness 20
 point_at <0,0,0>
 shadowless
}
//  */

object{ cube_init() }



the rubik.inc reads

#macro cube_init ()

#declare Front =
box{
        <0,0,0>,
        <1,1,.000001>

        texture {pigment{image_map{"Front.bmp" map_type 0}} scale 1}
        scale 3
}


#declare Count=1;
#while (Count <= 5)

        //object{ Front }



        #declare Count=Count+1;
#end
//object{ Front }

#end

When the object{ Front } is placed outside the while loop everything works
fine. When it is placed inside the loop, I get the following error.

"Parse Error: No matching } in 'object', object found instead"


-Jeff


Post a reply to this message

From: Bob H
Subject: Re: Syntax Help
Date: 27 Mar 2006 22:12:56
Message: <4428a9b8$1@news.povray.org>
You're asking it to hold more than one object {} for the loop in that macro. 
Use a union {} wrapped around the while loop instead and that should solve 
it.

I was going to back my answer up with proof from the Doc but all I found was 
the usage of object {} containing one item but not anything saying it 
couldn't hold more than one thing at a time. Which doesn't mean that it 
might not be explained anywhere, only that I hadn't seen it said.

-- 
Bob H  www.3digitaleyes.com
http://3digitaleyes.com/imagery/


Post a reply to this message

From: Warp
Subject: Re: Syntax Help
Date: 28 Mar 2006 00:59:37
Message: <4428d0c9@news.povray.org>
What you are trying to do is this:

object
{ object { ... }
  object { ... }
  object { ... }
  object { ... }
  object { ... }
}

  That's not possible.

  If you want to make a group of objects, which is then handled as one
object, you have to put them into a union, like this:

union
{ #declare Count = 0;
  #while(Count < 5)
    object { ... }
    #declare Count = Count + 1;
  #end
}

-- 
                                                          - Warp


Post a reply to this message

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