RectOut

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
mcsummation
Posts: 220
Joined: 23 Jan 2012, 17:07
Location: Round Rock, TX

RectOut

Post 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: )
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: RectOut

Post 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).
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
muntoo
Posts: 834
Joined: 01 Oct 2010, 02:54
Location: Your Worst Nightmare
Contact:

Re: RectOut

Post by muntoo »

Well, not unless you frequently put in negative values for the width and height. ;)
Image

Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE


Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
nxtboyiii
Posts: 366
Joined: 02 Oct 2010, 07:08
Location: Everywhere

Re: RectOut

Post 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.
Thanks, and have a nice day,
nxtboy III

programnxt.com
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: RectOut

Post by mattallen37 »

Which is the only exception I can remember (other than custom polygons, where you can do it however you want).
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
muntoo
Posts: 834
Joined: 01 Oct 2010, 02:54
Location: Your Worst Nightmare
Contact:

Re: RectOut

Post 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.
Image

Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE


Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: RectOut

Post 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
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: RectOut

Post 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.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: RectOut

Post 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.
nxtboyiii
Posts: 366
Joined: 02 Oct 2010, 07:08
Location: Everywhere

Re: RectOut

Post by nxtboyiii »

doc-helmut wrote:(especially nxtboy3)
Well, Excuse ME!! :P
Thanks, and have a nice day,
nxtboy III

programnxt.com
Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests