Skip to main content

Questions tagged [drawing]

The tag has no usage guidance.

1 vote
0 answers
61 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 ...
johnbakers's user avatar
2 votes
2 answers
163 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 ...
0x00001F's user avatar
0 votes
0 answers
90 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 ...
wlad's user avatar
  • 101
1 vote
1 answer
6k 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 ...
Simon's user avatar
  • 193
1 vote
2 answers
1k 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 ...
Gusman's user avatar
  • 111
1 vote
0 answers
156 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 ...
Julius's user avatar
  • 111
2 votes
1 answer
1k 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 ...
Voko's user avatar
  • 269
2 votes
1 answer
303 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: ...
Voko's user avatar
  • 269
1 vote
0 answers
21 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 ...
Makogan's user avatar
  • 1,736
3 votes
0 answers
563 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 ...
Roger Sanders's user avatar
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 ...
JarsOfJam-Scheduler's user avatar
2 votes
1 answer
101 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 ...
JDavila's user avatar
  • 31
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, ...
q9f's user avatar
  • 703
8 votes
2 answers
931 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 ...
AndrewSteer's user avatar
5 votes
2 answers
785 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? ...
Ecir Hana's user avatar
  • 1,459

15 30 50 per page