|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I don't know if this is a bug or not, but it I can't redefine a single component
of a vector with dot operators, i.e.:
#declare Vector = <0,0,0>;
#declare Vector.x = 5; //This sort of operation gives an error
I would expect it to result in <5,0,0>
I know this can be worked around, but I don't see why it should be illegal.
Margus
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
In article <365### [at] peakeduee> , Margus Ramst <mar### [at] peakeduee> wrote:
>I don't know if this is a bug or not, but it I can't redefine a single component
>of a vector with dot operators, i.e.:
>
>#declare Vector = <0,0,0>;
>#declare Vector.x = 5; //This sort of operation gives an error
>
>I would expect it to result in <5,0,0>
>I know this can be worked around, but I don't see why it should be illegal.
Thats simple: Its not in the language definition!
Thorsten
____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: Tho### [at] csicom
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Thorsten Froehlich <fro### [at] charliecnsiitedu> wrote:
>In article <365### [at] peakeduee> , Margus Ramst <mar### [at] peakeduee> wrote:
>> I don't know if this is a bug or not, but it I can't redefine a
>> single component of a vector with dot operators, i.e.:
>>
>> #declare Vector = <0,0,0>;
>> #declare Vector.x = 5; //This sort of operation gives an error
>>
>> I would expect it to result in <5,0,0>
>> I know this can be worked around, but I don't see why it should be illegal.
>
>Thats simple: Its not in the language definition!
Abstracting further:
Is a #define just macro substitution, like in C, or is it an
actual assignment operator?
-Rich
--
Rich Lafferty ---------------------------------------------------------
IITS/Computing Services | "Oderint dum metuant."
Concordia University | -- Lucius Accius (170-90 BC).
ric### [at] vax2concordiaca -----------------------------------------[McQ]--
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Rich Lafferty <ric### [at] vax2concordiaca> wrote:
: Is a #define just macro substitution, like in C, or is it an
: actual assignment operator?
It definitely is not a macro substitution, because this doesn't work:
#declare Test=
texture
{ pigment { rgb 1 }
normal { bumps .2 }
}
sphere
{ 0,1
Test
}
But you have to type this instead:
sphere
{ 0,1
texture { Test }
}
--
- Warp. -
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 17 Nov 1998 19:45:49 -0500, Rich Lafferty <ric### [at] vax2concordiaca> wrote:
>Abstracting further:
>
>Is a #define just macro substitution, like in C, or is it an
>actual assignment operator?
It's an actual assignment operator. POV parses whatever comes
after the #declare (not #define) and stores the binary result
of the parsing (i.e. an actual object, not a bit of text) in
a chunk of memory referenced by an entry in the symbol table.
When you use the #declared thing, POV copies this binary image
and puts the copy into your scene, with any modifications you
specify.
However, this doesn't actually have anything to do with the
original question. The stated behavior _could_ be implemented,
it just hasn't been. Since it's just syntactic sugar and could
be accomplished other ways, I see no reason to implement it
except perhaps for parallelism with C.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Of course it's not very important. I asked because I recently had to do sth.
like this:
#declare MyArray[Dim1][Dim2][Dim3][Dim4]=
<MyArray[Dim1][Dim2][Dim3][Dim4].x,
MyArray[Dim1][Dim2][Dim3][Dim4].y*Stuff,
MyArray[Dim1][Dim2][Dim3][Dim4].z>;
This would be much more elegant:
#declare MyArray[Dim1][Dim2][Dim3][Dim4].y=
MyArray[Dim1][Dim2][Dim3][Dim4].y*Stuff;
I'm just lazy, I guess...
Margus
Ron Parker wrote:
/.../
> Since it's just syntactic sugar and could be accomplished other ways, I see
> no reason to implement it except perhaps for parallelism with C.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
You could do a macro solution :
#macro SetComponent3D(V1, C, V2)
C * V2 + (<1, 1, 1> - C) * V1
#end
#declare MyArray[Dim1][Dim2][Dim3][Dim4] =
SetComponent3D (
MyArray[Dim1][Dim2][Dim3][Dim4],
y,
stuff * MyArray[Dim1][Dim2][Dim3][Dim4]
)
Okay, so it's not terribly elegent, but perhaps
it's better than nothing....
Margus Ramst wrote:
> This would be much more elegant:
>
> #declare MyArray[Dim1][Dim2][Dim3][Dim4].y=
> MyArray[Dim1][Dim2][Dim3][Dim4].y*Stuff;
>
> I'm just lazy, I guess...
--
http://www.flash.net/~djconnel/
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|