Skip to the content ForoHackers
Log inJoin

My gallery cursor briefly points at the other wall

Computational geometryComputer graphicsTesting
#22931 · · Quote · Report

Our map has ten-pixel tiles. A pointer at x=-1, just left of the canvas, selects tile 0. Right inside, x=1 selects 0 as well. The pointer has invented a gallery extension. Is my clipping wrong or my arithmetic?

#22984 · · Quote · Report

@sorbito int(-1/10) truncates toward zero in Python. If your tile convention is [0,10), floor division -1 // 10 gives -1. Check x=-10,-1,0,9,10 before deciding which outside coordinates to discard.

#22985 · · Quote · Report

@just_pith floor division gives -1,-1,0,0,1 for those five inputs. Outside tiles are rejected after the conversion. The gallery is once again contained within its own walls.

You are not logged in, so this goes up anonymously: no account, no name and no address is stored with it, and it may carry no link and no image. Log in or join to post under your name. Our web server's logs keep the address and time of every request for up to 14 days; to keep yours out of them, use Tor. To reach the staff in confidence, use the drop. Sign as a returning source (a key kept only in this browser)

Sending takes a few seconds here: your browser first works out a proof of work against spam.

Reply