You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Depending on the number of sides passed to DrawCylinder() (and it looks like DrawCylinderWires() as well) too much geometry is drawn, in effect one angle step too many, leading to overlapping geometry (or imprecisely placed) and z-fighting. This is noticeable when using a semi-transparent color.
Using the simple example below, with varying numbers of sides for the cylinder:
7 sides (incorrect)
8 sides (correct)
15 sides (correct)
16 sides (incorrect)
This seems to be caused by the integer math used in
…le (raysan5#4034)
* Fixraysan5#4024, cylinder drawing was incorrect due to imprecise angle
stepping (mostly noticeable with semi-transparent cylinders)
* Fix var name and spacing
Please, before submitting a new issue verify and check:
Issue description
Depending on the number of
sides
passed toDrawCylinder()
(and it looks likeDrawCylinderWires()
as well) too much geometry is drawn, in effect one angle step too many, leading to overlapping geometry (or imprecisely placed) and z-fighting. This is noticeable when using a semi-transparent color.Using the simple example below, with varying numbers of sides for the cylinder:
7 sides (incorrect)
8 sides (correct)
15 sides (correct)
16 sides (incorrect)
This seems to be caused by the integer math used in
raylib/src/rmodels.c
Line 520 in 1344979
The
rlVertex3f()
calls within the loop correctly use360.0f/sides
for the angle step, but the (integer) base offseti
is imprecise due to rounding.Environment
Arch Linux, GTX Titan V
Issue Screenshot
See above
Code Example
The text was updated successfully, but these errors were encountered: