6

Ok, Xenapior and Reynolds together have the right idea. But the explanation is a bit lacking so here is a image to explain it all and some further musings. First let us start by drawing an image (yes i know that is what they say in school for you to do but nobody does it). From the image we can see that there are 2 equal right triangles $V_2, A, C$ and $...


6

I have implemented the cartesian-to-polar-conversion and have used different interpolation methods: 1) nearest neighbor 2) a subsampling approach, which averages 81 subpixel locations 3) bilinear interpolation The 2nd row in the image below shows detail magnifications of the output for the three approaches: Here is the GLSL shader code for approach 1 ...


5

Your screen isn't 3D, so how do you display 3D objects on it? You need to map 3D coordinates into 2D space. This also explains why your OpenGL code is not behaving how you're expecting it to. Sorry if parts of this answer are things you already know (just trying to be comprehensive). What do the model view and projection matrices do? The model view matrix ...


4

Imagine that a black dot represents a value of -1 whereas a white dot represents a value of +1. You are looking for the iso-line(s) where each point upon the line is 0. For this example you could either place the iso-lines like on the left or the right: or The difference between the solutions is the value in the center. In the left case we assume 1s ...


4

You can use a shear, or equivalently a rotation by 45, scale along one of the axes, rotate back (which is equivalent to the shear which you are looking for). EDIT: On second thought, you don't need to even rotate back unless your circle is marked, since a circle is rotation invariant (if the rotation is around its center).


3

Picking up from step 2, where you generated line segments to represent individual stitches, I would first suggest that you apply rounded ends to each segment, rather than square ends. I would then convert each segment to an outline, (i.e. each rounded stitch becomes an separate poly-line representing the outer boundary.) For example, suppose you start with ...


2

Straight from the specification of lineTo: If the object's path has no subpaths, then ensure there is a subpath for (x, y). And "ensure that there is a subpath" links to this bit: When the user agent is to ensure there is a subpath for a coordinate (x, y) on a path, the user agent must check to see if the path has its need new subpath flag set. If it ...


2

The cut length from the vertex is x*ctan(t/2), where t is the angle at this vertex.


2

The 2D pipeline involves ... [coordinate transformation terms] Can someone give me the detail differentiation among these? This is something I very recently learned while trying to understand how software handles 3D graphics behind the scenes. I've never encountered these terms in reference to 2D graphics before, but the ideas still apply. 2D graphics ...


1

The mistake was in the multiplication order during the composition of the matrices. Since the OP was working with column vectors the correct order for transformations should have been $TRSA∗v$. The OP did the other way around, $ASRT*v$ thus the incorrect results. Also there need to be another $A^{\prime}$ matrix added which negates the translation done by ...


1

To get a proper circle, you can use a transformation matrix to transform your cell coordinates into equally spaced cartesian coordinates. In the case of your 50 x 100 pixel cells, your transformation matrix would probably either double the width or halve the height. So something like this: | 0.5 0.0 | | 0.0 1.0 | If you want to draw a circle of radius r at ...


1

Since you're working on CAD software, you probably want some precise results. Here an algorithm that could work: For each side: Compute the segment's equation. Compute each round corner's circle equation. Compute the intersections between the segment and each circle. The 2 intersection points are the new endpoints for the line segment. This doesn't handle ...


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

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

The first step in your existing code calculates the orientations of one line segment relative to each of the two end points of the other line segment, using the cross product. This allows testing whether the other line segment has one end point anticlockwise and the other end point clockwise from the first line segment, indicating that the line on which the ...


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