POV-Ray : Newsgroups : povray.newusers : Parse error Server Time
17 Jun 2025 04:34:10 EDT (-0400)
  Parse error (Message 1 to 2 of 2)  
From: SWG
Subject: Parse error
Date: 13 Jun 2025 18:00:00
Message: <web.684c9e87944b53bebf5fd15bd91c1e09@news.povray.org>
I was removing some stuff from a scene, tried to run it, but poof! I got an
error. "Expected object or directive, finish found instead" I tried to change up
the brackets, and everything seemed fine! But i keep getting the error.
the .pov:
#include "colors.inc"
finish {
  reflection 0
  ambient 0.1
  specular 0.4
}
camera {
 location <-14,5,15>
 look_at <0,0,0>
}
light_source {
 <4,7,8>
 White
}
sky_sphere {
 pigment {
  gradient y
  color_map {
   [0 color White]
   [1 color DarkTurquoise]
  }
  scale 2
  translate <0,1,0>
 }
}
box {
 <0,0,0>,<-3,3,3>
 pigment {
    Green
 }
}


Post a reply to this message

From: Bald Eagle
Subject: Re: Parse error
Date: 13 Jun 2025 22:30:00
Message: <web.684cddca236905a31f9dae3025979125@news.povray.org>
Well, you just have a finish statement hanging out in the middle of nothing.

If you wrap it in a default {} block, or apply that finish to your box by moving
inside the box {} statement's brackets, then all should be fine.

I incorporated both ways (plus newer requisite version and gamma) into the
following scene.

#version 3.8;

#include "colors.inc"
#global_settings {assumed_gamma 1.0}

#default {
 finish {
  reflection 0
  ambient 0.1
  specular 0.4
 }
}

camera {
 location <-14,5,15>
 look_at <0,0,0>
}

light_source {
 <4,7,8>
 White
}

sky_sphere {
 pigment {
 gradient y
  color_map {
  [0 color White]
  [1 color DarkTurquoise]
  }
 scale 2
 translate <0,1,0>
 }
}

box {
 <0,0,0>,<-3,3,3>
 pigment {
  rgb 1
 }
 finish {
  reflection 0
  ambient 0.1
  specular 0.4
 }
}


Hope that helps.

- BE


Post a reply to this message

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