Turtle position should correctly report location in turtle coordinates #81

Closed
opened 2024-06-17 18:58:54 +00:00 by scott · 2 comments
Owner

Current hack negates the x coordinate before translating the turtle; but then the internal representation has a negative number. Change the negation to the draw code, instead of the hack by negating the term in goto!

Current hack negates the x coordinate before translating the turtle; but then the internal representation has a negative number. Change the negation to the draw code, instead of the hack by negating the term in `goto!`
Author
Owner

There is almost certainly a way to use p5 transformations to make this work, but I reckon the thing to do here, now that computer class is all over, is to stand up a turtle graphics protocol out of Ludus, and then to write domain-specific handlers that translate turtle graphics protocol to whatever environment—SVG, some canvas/animation lib, a robot turtle, a 2D plotter, etc.

That way, we can just use turtle geometry in Ludus, and don't have to worry at all about the transformations that go into rendering lines and turtles.

Leaving this open to discuss in the coming weeks.

There is almost certainly a way to use p5 transformations to make this work, but I reckon the thing to do here, now that computer class is all over, is to stand up a turtle graphics protocol out of Ludus, and then to write domain-specific handlers that translate turtle graphics protocol to whatever environment—SVG, some canvas/animation lib, a robot turtle, a 2D plotter, etc. That way, we can just use turtle geometry in Ludus, and don't have to worry at all about the transformations that go into rendering lines and turtles. Leaving this open to discuss in the coming weeks.
scott added the
bug
label 2024-07-03 00:18:00 +00:00
scott added this to the Turtle Protocol & Adapters project 2024-07-21 17:40:17 +00:00
Author
Owner

Done in 121446c5c4. The turtle state is correctly calculated and reported, now. It's up to adapters to make sure the turtle graphics protocol is drawn correctly.

Done in https://alea.ludus.dev/twc/ludus/commit/121446c5c4246bb9a100bf56c9e36025496b738b. The turtle state is correctly calculated and reported, now. It's up to adapters to make sure the turtle graphics protocol is drawn correctly.
scott closed this issue 2024-07-21 23:27:11 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: twc/ludus#81
No description provided.