Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2]

Author Topic: Designate Line, Perimeter, Area, Ellipse  (Read 1546 times)

Granite26

  • Bay Watcher
    • View Profile
Re: Designate Line, Perimeter, Area, Ellipse
« Reply #15 on: January 06, 2009, 03:28:04 pm »

Also, How does the second radius work?  At a guess the first radius is the radius of the ellipse at the normal to the second one?
Assume that the starting point described is always the center point. If you move the first cursor up ten, you'd have a circle with a radius of ten squares. However, if you were, for example to take the second cursor, and move it diagonally up and right 20 squares, the point at which the first cursor is placed would not be perpendicular to the normal. Rather, it would simply guarantee that the edge of the ellipse intersects that point.

It might be easier to think of it like this. The points at which the cursors are placed would define an arc of the ellipse,  where the second cursor always defines a vertex. The rest of the ellipse can be extrapolated from that.


I'd post an off kilter mock up, but it looks really skewed without a square character set in the code blocks.

I'll have to convince myself that 2 points and the mean of the axis is sufficient to define an ellipse, but you're probably right.

My major concern about off kilter is that it wouldn't have a great deal of double thick to it.

How do you propose dealing with diagonals?  People can move diagonally, so it'd be pretty whack or else have a crazy thick ellipse in some places...

(For the 10 up and 5 up cases, that would create a straight line, wouldn't it?  How would you deal with that in the UI?)

Ampersand

  • Bay Watcher
    • View Profile
Re: Designate Line, Perimeter, Area, Ellipse
« Reply #16 on: January 06, 2009, 03:37:35 pm »

It might be easier to convince yourself that it's enough if you imagine that you're not actually defining two points on the ellipse, but four. The two described points, and the two points directly opposite of them.

In any case, when dealing with the problem you mentioned, how do you make it designate walls? A simple rule stating that if a square touches a square on the exterior of he circle, mark it for designation.

Secondly, I'd deal with it in the UI by having a preview of the area to be designated And when you're doing something weird, like moving the cursor along the same line as the first, I'd just ignore it.
Logged
!!&!!

Grek

  • Bay Watcher
    • View Profile
Re: Designate Line, Perimeter, Area, Ellipse
« Reply #17 on: January 06, 2009, 06:16:52 pm »

A simple way to fix it would be to simply make it so that both points cannot have the same x value or the same y value. [3,2]+[2,3] is valid (producing a slanted ellipse), but [3,2]+[3,2] is not.
Logged

Ampersand

  • Bay Watcher
    • View Profile
Re: Designate Line, Perimeter, Area, Ellipse
« Reply #18 on: January 07, 2009, 09:34:26 am »

Yes, however if you move the first up ten then move the second left five, up ten they have the same y value, but it remains a valid input.

As long as one value is different, the other can be anything.
Logged
!!&!!

Draco18s

  • Bay Watcher
    • View Profile
Re: Designate Line, Perimeter, Area, Ellipse
« Reply #19 on: January 07, 2009, 01:03:02 pm »

And if they are the same (+3,+2),(+3,+2) what do you have?

A circle.
Logged
Pages: 1 [2]