[A83] Re: Trouble with opx functions
[Prev][Next][Index][Thread]
[A83] Re: Trouble with opx functions
In a message dated 8/1/01 2:29:04 PM Central Daylight Time,
woutput@hotmail.com writes:
> I have a problem with opx's too:
>
> One of my first progs=simple:
>
> random
> op1toop4
> random
> op1toop3
> random
> op1toop2
> random
> cline (draws line from (OP1,OP2)-(OP3,OP4))
>
> The output of this program is very strange
>
> My window size needs to be:
> (xmin,ymin)-(xmax,ymax):
> (0,0)-(1,4100) !!!
> This is very strange and:
> one coordinate has always x=0 and the other coordinate has always
> y=0!
>
> Please reply,
>
> Wouter
The Random romcall destroys OP1 through OP3, leaving the result in OP1,
however you should assume the others to be trashed, so you cant store
previous information there and expect it to get to CLine correctly. So that
may be the first problem to your odd window coordinates, but perhaps there is
another problem as well. You might first try using CLineS, which takes
floating point number parameters on the Floating Point Stack (FPS). To
rewrite what you are trying to do would go something like this:
call Random
call PushRealO1
call Random
call PushRealO1
call Random
call PushRealO1
call Random
call PushRealO1
call CLineS
Even though those are all random right now and it doesnt matter what order
they go in, you would probably want to make some sense out of the order that
you push the X and Y coords onto the FPS, when you do have known coordinates.
The SDK says the they would be like this:
(X1,Y1) - (X2,Y2) must be: (FPS2,FPS3) - (FPS1,FPST)
meaning you push Y1 on first, then X1, then X2, then Y2. This order the SDK
says seems a bit non-sensical, so if I were you, I would test if it is X1 or
Y1 that should be pushed first, before you start using it with known
coordinates. Btw, CLine and CLineS both trash OP1 through OP6 for your
information. Hope this helps, cya.
-Jason K