Questions tagged [drawing]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
950 views

Using Bresenham's circle algorithm (or another alternative algorithm) to draw an arc

I'm trying to create some graphic functions for a ZX Spectrum (Z80) machine in assembler. I already have the basics except for the arc. I need a fast algorithm to draw an arc, ideally one that uses ...
1 vote
0 answers
51 views

How do freehand vector drawing tools typically decide where to place the control points?

I'm devising an algorithm to take a freehand curve and make a bezier spline from it. I can do this already just fine, but it's a naive implementation that creates about as many bezier curves as there ...
2 votes
2 answers
110 views

drawing ellipse with rotation cause inaccurate result

i'am a junior in computer graphics , currently i learn how to draw ellipses with rotation . when i preform rotation with 90deg or 180deg nothing unusual happened , but when i try to rotate with any ...
0 votes
0 answers
80 views

Algorithm for drawing generalised circles

A generalised circle is either a circle in the plane or a line. The general equation of one is: $$A(x^2 + y^2) + Bx + Cy + D=0,$$ where $4AD - B^2 - C^2 \leq 0$. This can be checked by completing the ...
0 votes
1 answer
4k views

Drawing a square using glDrawArrays with GL_TRIANGLES

I used a version of the following code to draw a triangle using glDrawArrays with GL_TRIANGLES, per Anton Gerdelan's very nice tutorial here: Hello Triangle ! It draws a nice triangle. I have modified ...
1 vote
0 answers
132 views

How to do a scanline fill with a self intersecting polygon?

I have a bezier curve and would like to draw it's stroke. To do that, I planned to approximate the stroke to a polygon and fill it with a scanline algorithm. While I feel confident about implementing ...
2 votes
1 answer
913 views

Bresenham circle drawing algorithm, compute the distance?

In the Bresenham circle drawing algorithm, we have to choose between the top and bottom pixel, but what we always do is using the circle's equation ($f(x, y) = x^2 + y^2 = r^2$) to determine which of ...
2 votes
1 answer
282 views

What is the point of having integer-based draw routines in software rasterizer?

I wonder why all the well known algorithms of drawing for example circles (bresenham, mid-point, etc) all use integer arithmetics? For example, here is a simple circle drawn with bresenham algorithm: ...
1 vote
0 answers
20 views

How to handle object drawables?

Currently the graphics API I am using is Vulkan, but I am trying to find a general enough way to represent the following. In graphics, drawing can be generalized as: Get vertex buffers and send them ...
3 votes
0 answers
518 views

Can you disable strip cutting (AKA primitive restart) on Direct3D 11?

Line strips and triangle strips are drawing modes supported across 3D graphics APIs, such as OpenGL, Direct3D, and Vulkan. When using indices to control drawing, a more recent feature is "strip ...
3 votes
0 answers
75 views

Why my cosine interpolation of a cube's face doesn't work?

NB please : executable use cases are available at the end of this question. I begin this question by showing you the problems of my program, then I explain how the latter works, and finally I end up ...
2 votes
1 answer
94 views

What is required to limit the amount of draw calls in Unity?

I would like to limit the amount draw calls to approximate performance. Is there a nominal amount to aim for when working with high performance gaming? From my understanding to render an object that ...
4 votes
1 answer
2k views

How to use 32 bit Integers for Element Indices in WebGL 1.0?

WebGL 1.0 specification does not allow to create 32-bit index buffers. Now I'm in trouble, I'm trying to render huge objects with 100 thousands to 1 million indices. In OpenGL this is no issue at all, ...
8 votes
2 answers
872 views

Can (and how so) shaders paint screen pixels beyond those that occupied by the shaded mesh?

I have some experience programming geometry and compute shaders - but never adventured myself in really playing with the fragment shaders. Currently, I am trying to better understand how they work and ...
12 votes
2 answers
2k views

Hardware-accelerated drawing of curved shapes

How to quickly draw a curved shape? by "quickly" I presume one should use hardware facilities as much as possible by "curved" I mean boundaries defined by either quadratic or cubic Bezier curves by "...
5 votes
2 answers
758 views

Blit and scroll

Could anyone please explain to me how drawing works with respect to scrolling? Suppose there is a window, which has an area where one can draw to (a "canvas"). Are there two copies of this canvas? ...