Page 1 of 3

RectOut

Posted: 12 Mar 2012, 18:55
by mcsummation
The documentation for RectOut says that the first 2 parameters specify the "The x/y value for the top left corner of the rectangle." It sure appears to me to be the bottom left corner. (Unless I'm messed up, again. :shock: )

Re: RectOut

Posted: 12 Mar 2012, 19:15
by mattallen37
It's probably just a documentation error. It wouldn't be the first or last.

Basically any x,y position on the NXT LCD starts at bottom left (because of the way the buffer is set up).

Re: RectOut

Posted: 18 Mar 2012, 01:54
by muntoo
Well, not unless you frequently put in negative values for the width and height. ;)

Re: RectOut

Posted: 18 Mar 2012, 02:02
by nxtboyiii
mattallen37 wrote:It's probably just a documentation error. It wouldn't be the first or last.

Basically any x,y position on the NXT LCD starts at bottom left (because of the way the buffer is set up).
Except on a circle, the X and Y start at the origin of the circle.

Re: RectOut

Posted: 18 Mar 2012, 02:20
by mattallen37
Which is the only exception I can remember (other than custom polygons, where you can do it however you want).

Re: RectOut

Posted: 19 Mar 2012, 20:33
by muntoo
mattallen37 wrote:Which is the only exception I can remember (other than custom polygons, where you can do it however you want).
And Ellipses. Which is weird, since I can't do ellipses with a diameter of an even number.

Re: RectOut

Posted: 19 Mar 2012, 20:53
by HaWe
mattallen wrote:Basically any x,y position on the NXT LCD starts at bottom left (because of the way the buffer is set up).
nxtboy3 wrote:Except on a circle, the X and Y start at the origin of the circle.
the x,y position ALWAYS starts counting at display zero which is at the bottom left corner on the NXT screen.
Also the ccordinates of the center of circles or the foci of ellipses start counting at the bottom left, they simply are relativ to this universal display zero point.
Just the sizes, diameters, or vertizes are related to different start points (relative or absolute).
That makes the definition of a square look a little weird compared to a triangle, a quadrangle, or a polygone.

But again: display zero is ALWAYS bottom left on the NXT, without any exception :D

Re: RectOut

Posted: 19 Mar 2012, 21:08
by mattallen37
Yes, EllipseOut is like CircleOut. Actually, the FW uses the same function. "CircleOut" just calls "EllipseOut", using radius for both horz. and vert. "radii".

What do you mean about not being able to use Ellipses with even numbers?

@Helmut, we aren't talking about the LCD cords. We are talking about the x,y position passed into the draw functions, compared to where the pixels are actually placed on the screen.

Re: RectOut

Posted: 19 Mar 2012, 21:19
by HaWe
actually I suspect some of you (especially nxtboy3) are confusing passing start points and sizes or radii vs. relative vertizes by counting from the zero point which is always bottom left.

Re: RectOut

Posted: 19 Mar 2012, 22:55
by nxtboyiii
doc-helmut wrote:(especially nxtboy3)
Well, Excuse ME!! :P