POV-Ray : Newsgroups : povray.general : Different error messages for same POV-file Server Time
10 Aug 2024 11:18:07 EDT (-0400)
  Different error messages for same POV-file (Message 1 to 10 of 24)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Tor Olav Kristensen
Subject: Different error messages for same POV-file
Date: 13 Mar 2000 07:44:48
Message: <38CCE1C6.4947A712@hotmail.com>
Hello

I'm trying to make some macros to enable me to 
experiment with different rotation matrix's. (That I 
later will apply to 3D vectors to get the desired 
rotation of the vector.)

I know about the built in rotate functions in POV-Ray. 
I just want to learn about rotation matrix's.

Each matrix is built up as an array of 3 3D-vectors 
each. And my macros again operate on these arrays.

My problem is that I get several different error 
messages when I try to Run the file below in this 
message (I did not alter it between the Runs).

Can anyone please tell me if I am doing anything wrong 
in my macros? (variable passing, variable declarations, 
variable name conflicts etc.)

I am using POV-Ray v3.1g.watcom.win32 (Pentium II 
optimized) and I am using a 100 MHz Pentium PC with 
32 MB RAM, running Windows 98.

Regards

Tor Olav

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


Here is some of the error messages:


  Warning Stream to console.......On
  #local PP = array[3]
  #local QQ = array[3]
  #local PP = Mtrans(NN)

  #local NN <----ERROR

C:\My documents\POVray-bilder\Matrix03_.inc:39: error: undeclared
identifier expected but float function 'clock_delta' found instead.


  Warning Stream to console.......On
  #local PP = array[3]
  #local QQ = array[3]
  #local PP = Mtrans(NN)

  #local NN <----ERROR

C:\My documents\POVray-bilder\Matrix03_.inc:39: error: undeclared
identifier expected but float function 'tan' found instead.


  Warning Stream to console.......On
  #local PP = array[3]
  #local QQ = array[3]
  #local PP = Mtrans(NN)

  #local NN <----ERROR

C:\My documents\POVray-bilder\Matrix03_.inc:39: error: undeclared
identifier expected but float function 'on' found instead.



  Warning Stream to console.......On
  #local PP = array[3]
  #local QQ = array[3]
  #local PP = Mtrans(NN)

  #local NN <----ERROR

C:\My documents\POVray-bilder\Matrix03_.inc:39: error: undeclared
identifier expected but float function 'abs' found instead.



  Warning Stream to console.......On
  #local PP = array[3]
  #local QQ = array[3]
  #local PP = Mtrans(NN)

  #local NN <----ERROR

C:\My documents\POVray-bilder\Matrix03_.inc:39: error: undeclared
identifier expected but float function  found instead.



  Warning Stream to console.......On
#)

  #local PP = array[3]
  #local QQ = array[3]
  #local PP = Mtrans(NN <----ERROR

C:\My documents\POVray-bilder\Matrix03_.inc:54: error: Cannot pass
uninitialized identifier as macro parameter.
Initialize first.



  Warning Stream to console.......On
  #local QQ = array[3]
  #local PP = Mtrans(NN)

  #local NN = array[3]
  #local NN[0] = <MM[0] <----ERROR

C:\My documents\POVray-bilder\Matrix03_.inc:40: error: Attempt to access
uninitialized array element.


Here is the POV-file that generates the errors:

// =============================================================
// 
// Copyright 2000 by Tor Olav Kristensen
// 
// =============================================================


#macro S3Prod(U, V, W)

  vdot(U, vcross(V, W))

#end


#macro Mcof(MM)

  #local NN = array[3]
  #local NN[0] = vcross(MM[1], MM[2]);
  #local NN[1] = vcross(MM[2], MM[0]);
  #local NN[2] = vcross(MM[0], MM[1]);
  
  NN

#end


#macro Mdet(MM)

  S3Prod(MM[0], MM[1], MM[2])
               
#end


#macro Mtrans(MM)

  #local NN = array[3]
  #local NN[0] = <MM[0].x, MM[1].x, MM[2].x>;
  #local NN[1] = <MM[0].y, MM[1].y, MM[2].y>;  
  #local NN[2] = <MM[0].z, MM[1].z, MM[2].z>;

  NN 
    
#end

          
#macro Mmult(MM, NN)

  #local PP = array[3]
  #local QQ = array[3] 
  #local PP = Mtrans(NN)
  #local QQ[0] = <vdot(MM[0], PP[0]), vdot(MM[0], PP[1]), vdot(MM[0],
PP[2])>;
  #local QQ[1] = <vdot(MM[1], PP[0]), vdot(MM[1], PP[1]), vdot(MM[1],
PP[2])>;
  #local QQ[2] = <vdot(MM[2], PP[0]), vdot(MM[2], PP[1]), vdot(MM[2],
PP[2])>;

  QQ  
  
#end


#macro Mscale(s, MM)

  #local NN = array[3]
  #local NN[0] = s*MM[0];
  #local NN[1] = s*MM[1];
  #local NN[2] = s*MM[2];

  MM
  
#end 


#macro Minv(MM)

  #local NN = array[3]
  #local PP = array[3]
  #local QQ = array[3]
  #local s = 1/Mdet(MM); 
  #local NN = Mcof(MM) 
  #local PP = Mtrans(NN)
  #local QQ = Mscale(s, PP) 

  QQ

#end


#declare MMi = 
array[3] { 
  <  2,  0,  6>, 
  <  8,  1, -4>, 
  <  0,  5,  7>
}

#declare QQi = array[3]
#declare QQi = Minv(MMi) 

#declare RRi = array[3]
#declare RRi = Mmult(MMi, Minv(MMi))


Post a reply to this message

From: Josh English
Subject: Re: Different error messages for same POV-file
Date: 13 Mar 2000 11:42:40
Message: <38CD1A4C.548C1ABE@spiritone.com>
What do you have for the version number in the scene. That can effect which
features are enabled or not. Also, are you using MegaPov? I usuall have to
add #version unofficial MegaPov 0.4; to my scenes to get those to work.

Josh

Tor Olav Kristensen wrote:

> Hello
>
> I'm trying to make some macros to enable me to
> experiment with different rotation matrix's. (That I
> later will apply to 3D vectors to get the desired
> rotation of the vector.)
>
> I know about the built in rotate functions in POV-Ray.
> I just want to learn about rotation matrix's.
>
> Each matrix is built up as an array of 3 3D-vectors
> each. And my macros again operate on these arrays.
>
> My problem is that I get several different error
> messages when I try to Run the file below in this
> message (I did not alter it between the Runs).
>
> Can anyone please tell me if I am doing anything wrong
> in my macros? (variable passing, variable declarations,
> variable name conflicts etc.)
>
> I am using POV-Ray v3.1g.watcom.win32 (Pentium II
> optimized) and I am using a 100 MHz Pentium PC with
> 32 MB RAM, running Windows 98.
>
> Regards
>
> Tor Olav
>
> mailto:tor### [at] hotmailcom
> http://www.crosswinds.net/~tok/tokrays.html
>

<snip>

--
Josh English
eng### [at] spiritonecom
"May your hopes, dreams, and plans not be destroyed by a few zeros."


Post a reply to this message

From: mr art
Subject: Re: Different error messages for same POV-file
Date: 13 Mar 2000 12:45:08
Message: <38CD2959.151A5E04@gci.net>
I know that these are not directly part of the problem,
but, s seems to be flagged as a reserved word in MegaPOV.


Tor Olav Kristensen wrote:
> 
> Hello
> 
> I'm trying to make some macros to enable me to
> experiment with different rotation matrix's. (That I
> later will apply to 3D vectors to get the desired
> rotation of the vector.)
> 
><snip>
> 
> #macro Mscale(s, MM)
> 
>   #local NN = array[3]
>   #local NN[0] = s*MM[0];
>   #local NN[1] = s*MM[1];
>   #local NN[2] = s*MM[2];
> 
>   MM
> 
> #end
> 
> #macro Minv(MM)
> 
>   #local NN = array[3]
>   #local PP = array[3]
>   #local QQ = array[3]
>   #local s = 1/Mdet(MM);
>   #local NN = Mcof(MM)
>   #local PP = Mtrans(NN)
>   #local QQ = Mscale(s, PP)
> 
>   QQ
> 
> #end


-- 
Mr. Art

"Often the appearance of reality is more important 
than the reality of the appearance."
Bill DeWitt 2000


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Different error messages for same POV-file
Date: 13 Mar 2000 17:17:52
Message: <38CD6815.BAB28BB6@hotmail.com>
Hi Josh

Thanks for replying.


Josh English wrote:
> 
> What do you have for the version number in the scene. That can effect which
> features are enabled or not. 

I had not put any #version declaration in the file. 

But now I did try to insert

#version 3.1;

at the beginning of the file, but the problems persists.
I still get wildly changing error messages for the same file. 
(I even got new ones.)

> Also, are you using MegaPov? I usuall have to
> add #version unofficial MegaPov 0.4; to my scenes to get those to work.

No, I am using plain POV-Ray v3.1g for Windows


Regards

Tor Olav

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

> Tor Olav Kristensen wrote:
> 
> > Hello
> >
> > I'm trying to make some macros to enable me to
> > experiment with different rotation matrix's. (That I
> > later will apply to 3D vectors to get the desired
> > rotation of the vector.)
> >
> > I know about the built in rotate functions in POV-Ray.
> > I just want to learn about rotation matrix's.
> >
> > Each matrix is built up as an array of 3 3D-vectors
> > each. And my macros again operate on these arrays.
> >
> > My problem is that I get several different error
> > messages when I try to Run the file below in this
> > message (I did not alter it between the Runs).
> >
> > Can anyone please tell me if I am doing anything wrong
> > in my macros? (variable passing, variable declarations,
> > variable name conflicts etc.)
> >
> > I am using POV-Ray v3.1g.watcom.win32 (Pentium II
> > optimized) and I am using a 100 MHz Pentium PC with
> > 32 MB RAM, running Windows 98.
> >
> > Regards
> >
> > Tor Olav


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Different error messages for same POV-file
Date: 13 Mar 2000 17:34:20
Message: <38CD6BF2.D5D56C4D@hotmail.com>
Hello mr. art

Thanks for replying.

Right now I did try to replace the s with other
variable names, but it didn't stop those ever-
changing error messages.

I'm just using plain POV-Ray (v3.1g) for Windows 
(Not MegaPOV).

I looked up reserved identifiers and keywords in
the help file, but I could not find 's' listed 
for this plain version of POV-Ray.

Regards

Tor Olav

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


"mr.art" wrote:
> 
> I know that these are not directly part of the problem,
> but, s seems to be flagged as a reserved word in MegaPOV.
> 
> Tor Olav Kristensen wrote:
> >
> > Hello
> >
> > I'm trying to make some macros to enable me to
> > experiment with different rotation matrix's. (That I
> > later will apply to 3D vectors to get the desired
> > rotation of the vector.)
> >
> ><snip>
> >
> > #macro Mscale(s, MM)
> >
> >   #local NN = array[3]
> >   #local NN[0] = s*MM[0];
> >   #local NN[1] = s*MM[1];
> >   #local NN[2] = s*MM[2];
> >
> >   MM
> >
> > #end
> >
> > #macro Minv(MM)
> >
> >   #local NN = array[3]
> >   #local PP = array[3]
> >   #local QQ = array[3]
> >   #local s = 1/Mdet(MM);
> >   #local NN = Mcof(MM)
> >   #local PP = Mtrans(NN)
> >   #local QQ = Mscale(s, PP)
> >
> >   QQ
> >
> > #end
> 
> --
> Mr. Art
> 
> "Often the appearance of reality is more important
> than the reality of the appearance."
> Bill DeWitt 2000


Post a reply to this message

From: John VanSickle
Subject: Re: Different error messages for same POV-file
Date: 13 Mar 2000 23:09:26
Message: <38CDBDFA.B52B3077@erols.com>
Tor Olav Kristensen wrote:
> 
> My problem is that I get several different error
> messages when I try to Run the file below in this
> message (I did not alter it between the Runs).

I have sometimes gotten error messages that seemed like the
wrong error message.  If I recall correctly, it turned out that
the actual error was at some point earlier than what the parser
flagged.

-- 
ICQ: 46085459


Post a reply to this message

From: Vahur Krouverk
Subject: Re: Different error messages for same POV-file
Date: 14 Mar 2000 03:39:23
Message: <38CDFB03.F82A8CEA@aetec.ee>
Tor Olav Kristensen wrote:
> 
> Hello
> 
Hello. 

Just a thought: try to add semicolons to lines, where they are
missing...


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Different error messages for same POV-file
Date: 14 Mar 2000 17:29:10
Message: <38CEBC39.582A511F@online.no>
Hello John

I too have got error messages pointing to the 
wrong point in my code when my error(s) were 
hidden somewhere earlier.

In these cases I just had to start commenting 
out code, changing variable names and moving 
things around until the error messages points 
at my real error.

I suspect that this may also be the case here,
and I have therefore tried to play around with 
my code before posting to this newsgroup... But 
I haven't had any luck smoking out my(?) errors 
yet.

But I have found out that if I replace the last 
line of these four:

#declare QQi = array[3]
#declare QQi = Minv(MMi) 

#declare RRi = array[3]
#declare RRi = Mmult(MMi, Minv(MMi))

with 

#declare RRi = Mmult(MMi, QQi)

then the error messages disappear.

This may be my solution for this time, but the 
problem still bothers me, because I want to be 
able to replace macros like e.g. this one:

#macro Minv(MM)

  #local NN = array[3]
  #local PP = array[3]
  #local QQ = array[3]
  #local s = 1/Mdet(MM); 
  #local NN = Mcof(MM) 
  #local PP = Mtrans(NN)
  #local QQ = Mscale(s, PP) 

  QQ

#end

with macors like this one:

#macro Minv(MM)

  Mscale(1/Mdet(MM), Mtrans(Mcof(MM))) 

#end

Lately I have also found that it seems that 
the more I do of the substitutions like the 
one above, the more it seems likely that I 
start getting those random changing error 
messages I have described earlier.

(It seems like I can do some substitutions 
without being punished.)

And now I don't know how to proceed in my 
hunt for these errors.

Am I the only one who is getting changing 
error messages when running the code I 
enclosed in my initial posting?

Regards

Tor Olav

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

John VanSickle wrote:
> 
> Tor Olav Kristensen wrote:
> >
> > My problem is that I get several different error
> > messages when I try to Run the file below in this
> > message (I did not alter it between the Runs).
> 
> I have sometimes gotten error messages that seemed like the
> wrong error message.  If I recall correctly, it turned out that
> the actual error was at some point earlier than what the parser
> flagged.
> 
> --
> ICQ: 46085459


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Different error messages for same POV-file
Date: 14 Mar 2000 18:09:40
Message: <38CEC5B6.C3C921B1@online.no>
Hi Vahur

Vahur Krouverk wrote:
> 
> Tor Olav Kristensen wrote:
> >
> > Hello
> >
> Hello.
> 
> Just a thought: try to add semicolons to lines, where they are
> missing...

Hmm...

I have been a little bit worried about my use of semicolons.

Earlier I have seen that too many missing semicolons can 
cause crashes of POV-Ray (on my Windows 98 machine at home, 
and if I remember right, also on my Windows NT4 machine at 
work).

Therefore I have looked through my code to make sure that I 
had put them where I thought they should be.

But your reply (thank you btw.) made me check both my code 
and the help file once again. 

Here are my (rather lengthy) findings:

When POV-Ray parses my file, I do not get any warning 
messages like this one:

warning: All #versions and #declares of float, vector, and 
color require semi-colon ';' at end.

So everything apparently looked fine, but I thought that
maybe my array declarations should have some semi-colons as 
well (even if array declarations aren't mentioned in 
messages like the one above.)

In the help file for Windows didn't have any luck finding
explicit instructions about whether I should use semi-colons
after array declarations or not.

But I found two code examples of array declarations:

The first one 

8< snip
 #declare MyArray = array[10];
 #declare MyArray[5] = pigment{White}  //all other elements must be
                     //pigments too.
8< snip

used semi-colon, and the second one

8< snip
 #declare MyArray = array[10]
 #declare MyGrid = array[4][5]
 #declare YourArray = MyArray  //this is ok
8< snip

did not.

So now I thought that I should try to insert some of them 
after my array declarations.

So I did, but now the parser started complaining about these 
semi-colons:

#declare NNi = array[3]; <----ERROR
error: object or directive expected but ; found instead.

... So now I am totally confused about semi-colons!

;(

Regards

Tor Olav

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


Post a reply to this message

From: Margus Ramst
Subject: Re: Different error messages for same POV-file
Date: 14 Mar 2000 22:35:42
Message: <38CF057C.6499B18E@peak.edu.ee>
Tor Olav Kristensen wrote:
> 
> I have been a little bit worried about my use of semicolons.
> 
> Earlier I have seen that too many missing semicolons can
> cause crashes of POV-Ray (on my Windows 98 machine at home,
> and if I remember right, also on my Windows NT4 machine at
> work).

This is new to me. You mean the machine crached? Or just POV quit parsing?
Usually, missing semi-colons should only produce warnings (at least in the
current version). Only in some macros have I seen actual errors caused by them.

> ... So now I am totally confused about semi-colons!
> 

Semi-colons should only go after declarations of floats and vectors (colours can
also be thought of as vectors).
If you are declaring an array, it should not have a semi-colon:

#declare MyArray=array[10]

If the docs said otherwse, this is a typo. However, if you are declaring an
element of an array, and that element is a float or a vector, it should have a
semi-colon:

#declare MyArray[0]=11.5;

See docs section "Declaring identifiers" for further reference.

Margus


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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