Jump to content

Circle approximations with tidy circumference


Recommended Posts

This icosagon has a circumference of 512 units, textures like SKSPINE2 will neatly wrap around without missing pixels. The diagonals are formed from Pythagorean triples so each side is a whole number.



This dodecagon will tile with textures that repeat in steps of 32 units or smaller.
The circumference of this shape is 416 but it can easily be scaled.

Share this post


Link to post

neat :)

I wonder if anyone has experimented with curve-tool equivalents? e.g. "If you apply a 180° curve to a straight line of length X, the resulting curve will have length divisible by 32/64/128, etc..". I think I remember plums had a post about this some time ago.. too lazy to search.

Share this post


Link to post
Ribbiks said:

neat :)

I wonder if anyone has experimented with curve-tool equivalents? e.g. "If you apply a 180° curve to a straight line of length X, the resulting curve will have length divisible by 32/64/128, etc..". I think I remember plums had a post about this some time ago.. too lazy to search.

I did indeed.

https://www.doomworld.com/vb/doom-editing/69581-making-circles-and-polygons-that-fit-textures-properly/

Rereading that now, it's actually a bit hard to follow without some more visuals. I could update/redo it if anyone was interested.

This approach is pretty nice because of how it avoids fractional line lengths, though.

Share this post


Link to post

Avoiding fractional line lengths for better tiling of textures is actually a futile effort. Due to inaccuracies of geometrical functions in the Doom renderer, textures may appear tiling beyond their actual width anyway, frequently displaying pixels on their right side that theoretically should have been hidden (which is highly noticeable with textures that change color right beyond the right side of the linedef). Same with top and/or bottom pixels, depending on pegging. Line lengths should have fractional parts between .5 and .75 to be "the least harmful".

Share this post


Link to post

Eternity has a renderer that, if I'm not mistaken, uses floating point instead of fixed point. That makes it much more precise and less prone to all these off-by-one texel errors.

ZDoom moved to floating point recently as well; I'm not sure to what extent the renderer was affected though.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...