POV-Ray : Newsgroups : povray.general : torus arrows : Re: torus arrows Server Time
25 Apr 2024 00:02:20 EDT (-0400)
  Re: torus arrows  
From: isuc60
Date: 14 Nov 2016 19:50:06
Message: <web.582a5a7a329b68a8116828db0@news.povray.org>
Thank all of you so much for your great help!

This is an awesome platform. My skill grows everyday. Now, I am able to use most
of techniques that you introduced.

Here comes with a new challenge. I want to read data from a file on my disk. The
data file has something like this

1.0, 2.0,3.0, 4.0, 5.0, 6.0
7.0, 8.0, 9.0, 10.0,11.0,12.0

I want to draw an arrow from
Vector (1,2,3) to Vector (4,5,6)
and so on.

I read most of the 2.8.4.3 File Input/Output, and one post on the forum.
This is my first script.

//---------------------Head------------------------

#declare Vector1 = array[2][3] //2 rows and 3 columns
#declare Vector2 = array[2][3]

#fopen MyFile "data" read
#fopen MyFile1 "data.out" write
#while (defined(MyFile))
#read (MyFile,VECTOR_IDENTIFIER,Vector1,Vector2)
#write (MyFile1,VECTOR_IDENTIFIER,Vector1,Vector2)// check what I am reading in
any data
#end
//---------------------end--------------------------------

Hey, this does not work. It only reads one line, and even the output has a wrong
number.

I would appreciate it if you could point out my mistakes.

Thanks a lot again!

Best wishes,

Guoping



"Bald Eagle" <cre### [at] netscapenet> wrote:
> Stephen <mca### [at] aolcom> wrote:
> >... you might get a better idea of your scene if you do
> > a render from the top, front and side. To adjust the translations and
> > see what is happening.
> >
> > Another thing that might be confusing is PovRay's coordinate system.
> > Normally the Y axis is up. Some other programs use the Z axis for up.
>
> Yes.
> Take all of your objects and put them inside one big union{}
>
> #declare Scene = union {
> (all of your scene objects)
> }
>
> Then you can:
> object {Scene translate x*10 rotate  y*90}
> object {Scene translate y*10 rotate -x*90}
>
> to get 3 orthogonal views.
>
> Stephen's suggestion about mapping out the axes so that you can keep track is a
> great one - it helps keep everything straight when you're trying to write SDL
> and get all the parameters right.
>
> Also, when using a difference, I find it helpful to define the object being
> subtracted as a separate object, then use it in the difference{}, but also PLACE
> IT into the scene with something like pigment {rgbt <1, 0, 0, 0.95>} so that it
> shows up as a transparent thing that you can see.   Because sometimes you make a
> mistake and the thing you want to subtract isn't in the right place or
> orientations at all, and this helps debug the scene.
>
> Great work so far - keep it up   :)


Post a reply to this message

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