Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Szymanski

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







These might not be the most smooth, but their advantage is that they fit on the 8 unit grid.

Share this post


Link to post

True, but I wanted to avoid inexact lengths (the 47 in your first pic is 46.64761....) as a fun experiment

Share this post


Link to post

Sorry, I didn't understand that until now. Here you go, then:



:D

EDIT: A little better one:

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×