POV-Ray : Newsgroups : povray.general : Could you look at my simple program? Drawing 100 particles in 3D box... Server Time
27 Dec 2024 21:26:09 EST (-0500)
  Could you look at my simple program? Drawing 100 particles in 3D box... (Message 1 to 3 of 3)  
From: James
Subject: Could you look at my simple program? Drawing 100 particles in 3D box...
Date: 19 Nov 2005 18:55:00
Message: <web.437fba185909e3a8cce6fd2b0@news.povray.org>
Hi!

With your help, I made program to draw spheres of 1000 in 3D box. But,I got
error message (" Parse error: Expected 'numeric expression', Undeclared
Identifier 'var1' found"). I could not fix this problem. Could you help me?

Also, I have text file for 3D particle position and position format in file
is as following:

1 2 3
3 3 4
4 4 5
etc.

Namely, particle position x,y,z are distinguished with space not with comma.
Is it fine?

Thank you very much.


//////////////////////////////////////////////////////////

#include "colors.inc"
  background { color Cyan }
  camera {
    location <0, 2, -3>
    look_at  <0, 1,  2>
  }

   light_source { <2, 4, -3> color White}

 #fopen MyFile "position1.txt" read
  #while (defined(MyFile))
    #read (MyFile,Var1,Var2,Var3)

    sphere {
    <var1, var2, var3>, 1
    texture {
      pigment { color Yellow }
      }
    }

  #end

//////////////////////////////////////////////////////////////////


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Could you look at my simple program? Drawing 100 particles in 3D box...
Date: 19 Nov 2005 19:45:01
Message: <web.437fc65fd3642847272622110@news.povray.org>
"James" <hy5### [at] hanmailnet> wrote:
> Hi!
>
> With your help, I made program to draw spheres of 1000 in 3D box. But,I got
> error message (" Parse error: Expected 'numeric expression', Undeclared
> Identifier 'var1' found"). I could not fix this problem. Could you help me?

....

>  #fopen MyFile "position1.txt" read
>   #while (defined(MyFile))
>     #read (MyFile,Var1,Var2,Var3)
>
>     sphere {
>     <var1, var2, var3>, 1
>     texture {
>       pigment { color Yellow }
>       }
>     }
>
>   #end

....

Try <Var1, Var2, Var3> instead of <var1, var2, var3>.

Variable names are case sensitive.

--
Tor Olav
http://subcube.com


Post a reply to this message

From: James
Subject: Re: Could you look at my simple program? Drawing 100 particles in 3D box...
Date: 19 Nov 2005 22:05:01
Message: <web.437fe6d8d3642847cce6fd2b0@news.povray.org>
"Tor Olav Kristensen" <tor### [at] REMOVETHISgmailcom> wrote:
> "James" <hy5### [at] hanmailnet> wrote:
> > Hi!
> >
> > With your help, I made program to draw spheres of 1000 in 3D box. But,I got
> > error message (" Parse error: Expected 'numeric expression', Undeclared
> > Identifier 'var1' found"). I could not fix this problem. Could you help me?
>
> ....
>
> >  #fopen MyFile "position1.txt" read
> >   #while (defined(MyFile))
> >     #read (MyFile,Var1,Var2,Var3)
> >
> >     sphere {
> >     <var1, var2, var3>, 1
> >     texture {
> >       pigment { color Yellow }
> >       }
> >     }
> >
> >   #end
>
> ....
>
> Try <Var1, Var2, Var3> instead of <var1, var2, var3>.
>
> Variable names are case sensitive.
>
> --
> Tor Olav
> http://subcube.com

It is working...

Thank you very much.


Post a reply to this message

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