POV-Ray : Newsgroups : povray.general : Can a variable not hold blob components ? Server Time
1 Nov 2024 12:21:59 EDT (-0400)
  Can a variable not hold blob components ? (Message 1 to 7 of 7)  
From: Tor Olav Kristensen
Subject: Can a variable not hold blob components ?
Date: 9 Jul 2000 12:31:27
Message: <3968A860.5C4B8676@online.no>
I want to do this:


#declare Spike = 
cylinder {
  0, y, 0.1
  strength 0.3
}
  
#declare Ball = 
sphere {
  <0, 0, 0>, 0.5
  strength 0.5
}


#macro InsertComp(Component, Position)

  object { // a "component {" keyword would be useful here
    Component
    translate Position
  }

#end // macro InsertComp


blob {
  threshold 0.3
  InsertComp(Ball, <0, 1, 0>)
  InsertComp(Spike, <0, 1, 0>)
  pigment { color <1, 0, 0> }
}


(Well, not really but this is a 
simplification of what I am trying to do.)

But I only get this error message:
"error: No matching } in cylinder, strength found instead"

=(

Any suggestions ?


Tor Olav
--
mailto:tor### [at] hotmailcom
http://www.crosswinds.net/~tok/tokrays.html


Post a reply to this message

From: Chris Huff
Subject: Re: Can a variable not hold blob components ?
Date: 9 Jul 2000 12:49:35
Message: <chrishuff-B232B7.11495409072000@news.povray.org>
In article <3968A860.5C4B8676@online.no>, Tor Olav Kristensen 
<tor### [at] onlineno> wrote:

> But I only get this error message:
> "error: No matching } in cylinder, strength found instead"

Blob components can not be declared. You could get around this by having 
the macros generate the components instead of taking them as a 
parameter, though.

-- 
Christopher James Huff - Personal e-mail: chr### [at] maccom
TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
Personal Web page: http://homepage.mac.com/chrishuff/
TAG Web page: http://tag.povray.org/


Post a reply to this message

From: Dave Blandston
Subject: Re: Can a variable not hold blob components ?
Date: 9 Jul 2000 13:13:07
Message: <3968b2a3$1@news.povray.org>
I had the same problem recently, and I just figured I was doing something
wrong (as usual).

Regards,
Dave

"Chris Huff" <chr### [at] maccom> wrote in message
news:chrishuff-B232B7.11495409072000@news.povray.org...
> In article <3968A860.5C4B8676@online.no>, Tor Olav Kristensen
> <tor### [at] onlineno> wrote:
>
> > But I only get this error message:
> > "error: No matching } in cylinder, strength found instead"
>
> Blob components can not be declared. You could get around this by having
> the macros generate the components instead of taking them as a
> parameter, though.
>
> --
> Christopher James Huff - Personal e-mail: chr### [at] maccom
> TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
> Personal Web page: http://homepage.mac.com/chrishuff/
> TAG Web page: http://tag.povray.org/


Post a reply to this message

From: Josh English
Subject: Re: Can a variable not hold blob components ?
Date: 10 Jul 2000 12:53:36
Message: <3969FFCD.5463345B@spiritone.com>
When I get this error with blobs, I start adding commas. I'd try
removing the strength keywords with commas in the Spike and Ball
declaration and see if it works. You might also add the strength value
as a parameter in the macro and add it in the macro instead ofthe
declarations, so that Spike and Ball can be used outside of a blob as
well.

--
Josh English -- Lexiphanic Lethomaniac
eng### [at] spiritonecom
The POV-Ray Cyclopedia http://www.spiritone.com/~english/cyclopedia/


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Can a variable not hold blob components ?
Date: 10 Jul 2000 22:40:52
Message: <396A88C1.9F6CE833@online.no>
Josh English wrote:
> 
> When I get this error with blobs, I start adding commas. I'd try
> removing the strength keywords with commas in the Spike and Ball
> declaration and see if it works. 

I think I tried that and found 
that this didn't work either.


> You might also add the strength value
> as a parameter in the macro and add it in the macro instead ofthe
> declarations, so that Spike and Ball can be used outside of a blob as
> well.

But I can see no way that the 
macro can modify an object {} 
passed to it in a variable, so 
that it becomes a blob component.

I.e.: One cannot do this (I think):


#declare Spike = cylinder { 0, y, 0.1 }

#declare Ball = sphere { <0, 0, 0>, 0.5 }

#macro InsertComp(Component, Strength, Position)

  object {
    Component
    strength Strength
    translate Position
  }

#end // macro InsertComp


blob {
  threshold 0.3
  InsertComp(Ball, 0.5, <0, 1, 0>)
  InsertComp(Spike, 0.3, <0, 1, 0>)
  pigment { color <1, 0, 0> }
}


Thank you for commenting btw.


Tor Olav
--
mailto:tor### [at] hotmailcom
http://www.crosswinds.net/~tok/tokrays.html


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Can a variable not hold blob components ?
Date: 10 Jul 2000 22:41:56
Message: <396A8906.34C0BBCE@online.no>
Chris Huff wrote:
> 
> In article <3968A860.5C4B8676@online.no>, Tor Olav Kristensen
> <tor### [at] onlineno> wrote:
> 
> > But I only get this error message:
> > "error: No matching } in cylinder, strength found instead"
> 
> Blob components can not be declared. 

That was what I figured.
But for me it would be useful to 
being able to do just that.

Someone give me a component {} 
statement please !

> You could get around this by having
> the macros generate the components instead of taking them as a
> parameter, though.

Then I would have to rewrite the 
macro each time I wanted to transform 
or texturize a component in a 
different way. :(


Tor Olav
--
mailto:tor### [at] hotmailcom
http://www.crosswinds.net/~tok/tokrays.html


Post a reply to this message

From: Peter Popov
Subject: Re: Can a variable not hold blob components ?
Date: 11 Jul 2000 04:13:09
Message: <n1ilmscglj3cj4jusjvgnau17289jqvv56@4ax.com>
On Tue, 11 Jul 2000 04:40:07 +0200, Tor Olav Kristensen
<tor### [at] onlineno> wrote:

>> You could get around this by having the macros generate the components 
>> instead of taking them as a parameter, though.

>Then I would have to rewrite the macro each time I wanted to transform 
>or texturize a component in a different way. :(

Why? Pass the texture as another parameter :)


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] usanet
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

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