# Tag Info

15

As TheBuzzSaw said, it does depend on lots of things, including implementations of the rasterized graphics vs the vector graphics. Here are some high performance vector graphics methods that are rendered using traditionally rasterization methods. Loop and Blinn show how to render a vector graphics quadratic bezier curve by rendering a single triangle, and ...

11

As as far as I can tell Illustrator has 2 or 3 different rasterizer. The onscreen preview is also prone to the same gap artifacting as your show though its tuned to minimize the effect. Your post seems to imply that your interested in the "art optimized" output. Image 1: The different render modes of illustrator. Art optimized on left and hinted on right. ...

8

There might be. Less technical answer: If you're building a website or another application where you have nothing to do with the graphics programming then the answer is probably yes. The underlying APIs will try to guess how to render them and cache them efficiently. However, as your application runs and the API sometimes guesses incorrectly it may have to ...

7

What you (probably) want to achieve is something like this: When having a closer look at one of the corners and add a few lines, we see this: The black lines indicate that the center points of the circles along the borders of the red and blue boxes is the same. If the outer radius of the red box, for example, is $50px$, and the distance between the outer ...

6

Note: I have answered before the edit from trichoplax and I thought you were searching for other transformations other than the one you mentioned. The informations below are still useful so I will keep the answer here, but it does not directly answer your question. Affine transformations (surprise!) map affine spaces to affine spaces. An affine space is ...

6

There are a few ways of rendering vector graphics. As TheBuzzSaw mentions, NVIDIA has an extension that can render general paths quite quickly (but of course it only works on NVIDIA GPUs). And Alan Wolfe mentions the implicit surface methods (Loop-Blinn/distance fields), which define a function which says whether you're inside or outside a shape, and color ...

4

Instead of using cubic Bezier spline, you should use cubic Hermite spline. For cubic Hermite curve you specify the segment end points and tangents, which is what you then control in the tool. Hermite spline is almost the same as Bezier spline but with different $B$ matrix, so if you already understand Bezier, then understanding Hermite is a trivial step. So ...

4

And just to add: it is called "conflation" artifact and this is what AntiGrain Geometry used the compound shapes rasterizer for, see: flash_rasterizer.png http://agg.sourceforge.net/antigrain.com/demo/flash_rasterizer.png Also, this is what NV Path Rendering claims to improve on: An Introduction to NV_path_rendering (p. 67) or NV_path_rendering FAQ (#29).

3

The main part of it is simply Pythagoras's Theorem. The square root gives the length of the central line segment (which is the hypotenuse of a triangle formed by the change in x and change in y). The ratio between the hypotenuse and the change in x is the same as the ratio between the line width and the line width in y (they are similar triangles). Dividing ...

3

These rely on a transformation from global coordinates to path local coordinates, where the local axes are along and out (or more often u and v). In essence this all works on a principle similar to how offset works. Image 1: Depiction of local axes. Now the first one ($A$) is a sweep of an oval. Which is technically the most challenging of the four. In ...

3

In general, I recommend the book Real-Time Collision Detection. For your particular case, my first choice would be to use the 3D test for point-inside-mesh. I assume that the contour is a sequence of 2D segments (a sequence of vertices, essentially) and that the model mesh is "sealed", i.e. there are no holes in its surfaces that would make distinguishing ...

3

You can use the depth buffer to ensure that the second time you get on a point the pixels aren't written. You start with the maximum depth value and each new path (that you want to add to the existing drawn image) you decrement the depth.

3

Deducing the angle and rotating by that angle works quite well in 2D (describe in TLousky's post). This strategy, does not extend very well into three-dimensional realm. I will provide an alternative solution that shows a general strategy that works in a larger set of cases. As a bonus this without needing to think of trigonometry as it can be encoded away. ...

3

Most mesh drawing tools use triangles to draw meshes, for technical reasons. You could simply specify the coordinates of the three vertices of each triangle, but that is a bit wasteful in terms of memory. What is done in many places is to specify a list of points in space, with their coordinates, and then specify a list of triangles, using indices of the ...

2

This algorithm is based on this answer for finding the angle between vectors, and this answer for rotating polygon points. It's written in Python, and assumes you want to align an edge with the X axis (horizontal axis). If you want to align it with the Y axis, replace the xVec in the code below with a yVec = [0,1]. EDITED: Added code for rotating the ...

2

The values will only form a cube after performing the perspective divide, which I don't see happening in your code. That is, you take a vector $[x, y, z, 1]$ and transform it by the projection matrix, resulting in a new vector $[x', y', z', w']$. Then divide out the fourth component to get a 3D vector, $[x'/w', y'/w', z'/w']$. This last is the one that ...

2

Since you have a limited set of tools you are not actually doing a classical fitting. What you have is a discrete problem. And since you are looking for a somewhat easily drawn fit, no more than twice segmented for example. One way to approach this is to find all the points that match your curvature requirements. Then find the point x units away from point ...

2

If you can assume the subpaths are non-intersecting (and non-self-intersecting), and that the fill rule is always the nonzero rule, the easiest way is probably to pick the first point on the first subpath, and do a standard point-in-polygon test with the polygons defined by each other subpath. If the point is not inside any other subpath, then this subpath ...

2

The way I would approach this is to get the outline curves of the font and then break each one down into some fixed number of steps (like, say, 100), and make a series of very small straight lines. So if you've got some bezier curve, you loop t from 0 to 1 in 100 steps and plug it into the equation: double x = calculateBezier(0.0, c0.x, c1.x, c2.x, c3.x); ...

2

To align vectors, you are applying a rotation. If you consider a simple rotation matrix, e.g. rotation of angle $\theta$ around Z axis, then you will trivially see that its inverse matrix, a rotation of $-\theta$, is the transpose, since $sin(-\theta)=-sin(\theta)$ and $cos(-\theta)=cos(\theta)$. An arbitrary rotation matrix, R, can be constructed by ...

2

e = (float)(delta_x / delta_y) - 1.0; e += (float)delta_x / delta_y; Either of these lines will cause a divide-by-zero error when delta_y is zero, which is when the line is horizontal (or zero-length). You need to check for this condition and have some special-case code. As an aside, I don't know why people still teach Bresenham's algorithm to new CG ...

1

One rasterization method I like is Haar wavelet rasterization: http://faculty.cs.tamu.edu/schaefer/research/wavelet_rasterization.pdf It can render polygons and Bezier curve shape and good for different resolution. I not see this algorithm in computer graphics books.

1

This would be considered isometric. Isometric graphics were originally used to give a 3D look, when computers could not handle actual 3D graphics. The creation of this image, however, is different than described in the Wikipedia article. The creator started by making the scene in 3D. This means, doing normal three dimensional modeling. After the scene is ...

1

If I understand correctly, you want to draw 2 objects mirrored with respect to an arbitrary line. Then when you move 1 object you want the other (reflection) to move with respect to that reflected line. A more sophisticated way of doing this would be using transformation matrices. That way you wouldn't have to worry about moving the mirrored triangle. You ...

1

To mirror an object in relation to an arbitrary line, you first have to find the coordinates of that object in the frame of reference of that line. For convenience, we will define a frame of reference where the $X$ axis is colinear with the line itself and the $Y$ axis will be perpendicular to the line. Then, we can flip the Y coordinate in that frame of ...

1

The way I read it, you have a 2D cubic Bézier that defines the projections of the ridge line (or river bed, or whatever) onto the X/Y plane. In Figure 4, these are the dark purple lines. So that gives you the direction that the ridge line moves. Now you have to define the height of the ridge line. This is done by picking some points along the 2D Bézier and ...

1

Vanishing points are "points at infinity" in projective geometry, which are represented by $w = 0$ in homogeneous coordinates. You can construct the vanishing point of a ray or line by taking its $xyz$ direction vector and adjoining $w = 0$. (For a line, use the direction vector and its negation to get vanishing points in both directions.) Then you can ...

1

If we sidestep your typo (the last term has one absolute too much), both formulations are correct. They just express different things. The $k$ in Hooke's law is for a particular spring. $k_s$ is the siffness for a paricular material. Now in the linear portion there is a direct relationship betwen these the material stffness is directly propotional to the ...

1

There is no general algorithm for packing problems. Only some of the special cases have known, and optimal, solutions. If you are packing one shape then finding a reasonable solution is possible. Like the known cases of hexagonal packing etc. However, if you have multiple diffenently sized objects then easy just flew out of the door. Some heurestics have ...

1

In pseudocode For each rectangle: If the rectangle overlaps the selection area, highlight the rectangle This is all that is required for a correctly working approach, but there are a number of other things you might need to take into account if this approach performs too slowly. I recommend implementing the simple approach, and once it works correctly ...

Only top voted, non community-wiki answers of a minimum length are eligible