POV-Ray : Newsgroups : povray.newusers : Problem with 'object' errors? Server Time
31 Jul 2024 04:19:18 EDT (-0400)
  Problem with 'object' errors? (Message 11 to 18 of 18)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Jessie K  Blair
Subject: Re: Problem with 'object' errors?
Date: 16 Jun 2003 03:17:55
Message: <3eed6f23$1@news.povray.org>
I guess that never occurred to me, possibly since I have experience with web
development and some application development as well.
Normally when using objects I just put them all at the end of the file in a
long list of OBJECT statements. This is my first attempt at making a macro,
and I didn't realize that the multiple objects within the macro were trying
to be processed as a single object within the final object statement at the
end of the file.

"Hughes, B." <omn### [at] charternet> wrote in message
news:3eed6b42@news.povray.org...
> "Lutz-Peter Hooge" <lpv### [at] gmxde> wrote in message
> news:3eed6582$1@news.povray.org...
> > Jessie K. Blair <jbl### [at] earthlinknet> wrote:
> >
> > > When I run this code I get an error from the parser that states "Parse
> > > error: No matching } in 'object', object found instead.
> >
> > There can be exactly one object inside 'object{...}'. Your macro
> > generates many objects, so you must use a union instead.
>
> Glad you knew that, I think a lot of people might believe you could group
> things into a single object statement for it to act similar to union. It's
> something I had to think twice about although I knew that was the obvious
> answer, because if I were to write this:
>
> #declare AllObjects=
> object {
>  object {Object1}
>  object {Object2}
>  texture {ObjTex)
> }
>
> couldn't you imagine the object wrappers might collect them into a group
> same as union does? Perhaps not if there weren't 'object' for each
> (identifier alone)...  Just one of those things that seems plausible until
> the error proves otherwise.
>
> Bob H.
>
>


Post a reply to this message

From: Warp
Subject: Re: Problem with 'object' errors?
Date: 16 Jun 2003 03:31:04
Message: <3eed7237@news.povray.org>
Jessie K. Blair <jbl### [at] earthlinknet> wrote:
> object { OrbitalSphere (MajorRadius, MinorRadius, Diff_Radius, SphereTex,
> OrbitlTex) }

  As people have already told you, that's your problem.
  'object' can hold only one object, while OrbitalSphere() creates many.

> #declare CountR=0;
> #declare CountN=0;

> #while (CountR <= Row_Orbs)
>    #while (CountN <= Num_Orbs)
>       object { Orbital translate <OrbitR, CountR, 0> rotate <0, CountN, 0> }
>       #declare CountN = CountN+1;
>    #end
>    #declare CountR = CountR+1;
> #end

  By the way, is it intentional that you don't reset CountN at the
beginning of the inner loop?
  At the second loop of the outer loop, CountN will be equal to Num_Orbs
and thus the inner loop is not executed at all. This makes the outer loop
obsolete (because the inner loop is executed just once and that's it).

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: Hughes, B 
Subject: Re: Problem with 'object' errors?
Date: 16 Jun 2003 03:34:11
Message: <3eed72f3@news.povray.org>
"Jessie K. Blair" <jbl### [at] earthlinknet> wrote in message
news:3eed6f23$1@news.povray.org...
> I guess that never occurred to me, possibly since I have experience with
web
> development and some application development as well.
> Normally when using objects I just put them all at the end of the file in
a
> long list of OBJECT statements. This is my first attempt at making a
macro,
> and I didn't realize that the multiple objects within the macro were
trying
> to be processed as a single object within the final object statement at
the
> end of the file.

Perfectly understandable. What it *does* allow for is to apply texture
(pigment, etc.) and/or use transformations, whatever else legal, so that any
premade object can always be reobjected (sorry, only way I could sum that up
in a word)and those things done to it.

#declare Sphere=
object {
    sphere {0,1}
}

#declare GreenSphere=
object {
    Sphere
    pigment { green 1 }
}

#declare MovedGreenSphere=
object {
    GreenSphere
    translate y
}

And that could go on and on. Probably best described as a container for
using object modifiers (per all other rules of how POV-Ray works) but only a
part of CSG if 'inverse' is used in it, or identifier needing a wrapper. Or
at least I think I can say that and not be wrong.  :-)

Bob H.


Post a reply to this message

From: Hughes, B 
Subject: Re: Problem with 'object' errors?
Date: 16 Jun 2003 03:40:36
Message: <3eed7474$1@news.povray.org>
"Hughes, B." <omn### [at] charternet> wrote in message
news:3eed72f3@news.povray.org...
> part of CSG if 'inverse' is used in it, or identifier needing a wrapper.
Or
> at least I think I can say that and not be wrong.  :-)

clipped_by and bounded_by, too. Just knew I was going to get into trouble if
I tried to say it had little to do with Constructive Solid Geometry just so
you'd think of it differently from the other CSG stuff.


Post a reply to this message

From: Jessie K  Blair
Subject: Re: Problem with 'object' errors?
Date: 16 Jun 2003 04:11:03
Message: <3eed7b97@news.povray.org>
Yes, I caught that problem as well.
Right now, my loop looks like this:

#while (CountR <= Row_Orbs)
   #declare CountN=0;
   #while (CountN <= Num_Orbs)
      object { Orbital translate <OrbitR*(Row_Orbs+CountR), CountR, 0>
rotate <0, CountN*OrbitR, 0> }
      #declare CountN = CountN+1;
   #end
   #declare CountR = CountR+1;
#end

I'm not very good with Mathematics and what I'm trying to do is create
something like this:

Take a sphere and then place many smaller spheres around it, each a constant
distance from the surface of the larger sphere.
Basically, a sphere within a sphere of spheres... if you can imagine that.

I do not understand how to plot points around a sphere at a constant
distance from the surface of the sphere.
I've been trying to take one band of the smaller spheres and rotate them
along the z-axis, which does what I want it to, but then I have the problem
of spheres overlapping at the poles.


"Warp" <war### [at] tagpovrayorg> wrote in message
news:3eed7237@news.povray.org...
> Jessie K. Blair <jbl### [at] earthlinknet> wrote:
> > object { OrbitalSphere (MajorRadius, MinorRadius, Diff_Radius,
SphereTex,
> > OrbitlTex) }
>
>   As people have already told you, that's your problem.
>   'object' can hold only one object, while OrbitalSphere() creates many.
>
> > #declare CountR=0;
> > #declare CountN=0;
>
> > #while (CountR <= Row_Orbs)
> >    #while (CountN <= Num_Orbs)
> >       object { Orbital translate <OrbitR, CountR, 0> rotate <0, CountN,
0> }
> >       #declare CountN = CountN+1;
> >    #end
> >    #declare CountR = CountR+1;
> > #end
>
>   By the way, is it intentional that you don't reset CountN at the
> beginning of the inner loop?
>   At the second loop of the outer loop, CountN will be equal to Num_Orbs
> and thus the inner loop is not executed at all. This makes the outer loop
> obsolete (because the inner loop is executed just once and that's it).
>
> --
> #macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb
x]
> [1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
> -1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// -
Warp -


Post a reply to this message

From: Hughes, B 
Subject: Re: Problem with 'object' errors?
Date: 17 Jun 2003 15:02:07
Message: <3eef65af@news.povray.org>
"Jessie K. Blair" <jbl### [at] earthlinknet> wrote in message
news:3eed7b97@news.povray.org...
>
> Take a sphere and then place many smaller spheres around it, each a
constant
> distance from the surface of the larger sphere.
> Basically, a sphere within a sphere of spheres... if you can imagine that.

Ah yes, too bad you hadn't said that first because if you were to search
these povray newsgroups you'd possibly had found the answer. It's been
something discussed many times in the past.

Easiest way to search is through the web page at http://news.povray.org/

And here is a find from one such search (after you've already set your
preferences up via link above):
http://news.povray.org/povray.general/28127/

I noticed you were asking about this sort of thing before, back in January
of this year.


Post a reply to this message

From: Jessie K  Blair
Subject: Re: Problem with 'object' errors?
Date: 17 Jun 2003 22:51:58
Message: <3eefd3ce@news.povray.org>
Indeed, and thank you.
When I asked about it earlier this year, I was on a military computer in
Afghanistan. Once I came home, I lost all that data, and for some reason, my
Outlook Express doesn't download all the messages properly even when
synchronize and have it set to "All Messages".

Anyhow, thank you for the information, and I'm off to run that search just
as you mentioned.

"Hughes, B." <omn### [at] charternet> wrote in message
news:3eef65af@news.povray.org...
> "Jessie K. Blair" <jbl### [at] earthlinknet> wrote in message
> news:3eed7b97@news.povray.org...
> >
> > Take a sphere and then place many smaller spheres around it, each a
> constant
> > distance from the surface of the larger sphere.
> > Basically, a sphere within a sphere of spheres... if you can imagine
that.
>
> Ah yes, too bad you hadn't said that first because if you were to search
> these povray newsgroups you'd possibly had found the answer. It's been
> something discussed many times in the past.
>
> Easiest way to search is through the web page at http://news.povray.org/
>
> And here is a find from one such search (after you've already set your
> preferences up via link above):
> http://news.povray.org/povray.general/28127/
>
> I noticed you were asking about this sort of thing before, back in January
> of this year.
>
>


Post a reply to this message

From: skrillian
Subject: Re: Problem with 'object' errors?
Date: 19 Jun 2003 07:07:11
Message: <3ef1995f$1@news.povray.org>
On Mon, 16 Jun 2003 01:51:31 -0400, Jessie K. Blair wrote:

> When I run this code I get an error from the parser that states "Parse
> error: No matching } in 'object', object found instead. The error
> highlights the object statement nested within the #WHILE loops. Anyone
> have any clue why this problem is occuring, when it should not be a
> problem at all?
 
	Almost every editer has a way to match up ([{ with [{) on the other
side. 

	Search the help on the one you are using or get one that does do the
matching for you. 

	It is a standard feature because almost all code is copied and
programmers certainly include the feature as it saves so many of them
from insanity for exactly the same error message you are getting.


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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