Hot answers tagged

18

World coordinates are at the bedrock of your game world. The 3D positions of all objects are ultimately specified in world space, either directly or through a node hierarchy. The ground, buildings, trees, and other stationary things will be fixed in world space. Gameplay calculations and physics will be done in world space (perhaps with some local ...


13

I use a variety of tools depending on the particular needs of the moment. I have a bias toward free tools, as I don't have access to things like Illustrator or Mathematica. For general vector art purposes I use the free Inkscape. It operates on .svg files and can also render them out as high-quality .pngs or other bitmap formats. For example, here's a ...


12

Personally my choice of poison is Adobe Illustrator. Other apps such as inkscape, Corel Draw, Xara Designer will also do. In a pinch even PowerPoint will work. Though I do not personally recommend PowerPoint due to severe issues with its data model, even tough is possibly worlds most deployed drawing app. It can also be a good idea to have a graphing ...


7

You have to distinguish the text and graphical modes of the graphics board of your machine. In the old days, mostly the text mode was supported. In this mode the board took care of storing the bitmap definition of the characters and displaying them at the current cursor position. All you had to do was to provide the ASCII code of the character (one byte per ...


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 ...


7

Rather than using an image, I would suggest doing this kind of effect using a shader. I'm not familiar with Cocos2d-x, but some quick googling suggests that it can work with shaders. You'd use a pixel shader that calculates the distance of each pixel to the center of the pulse effect, then applies a function based on that distance to define the shape and ...


6

I found a solution to my specific problem. Instead of computing the determinant and hitting the precision wall, I use the Gauss-Jordan method step by step. In my specific case of affine transformation matrices and the range of values I use, I don't hit any precision problem this way.


5

From the GIMP docs: IIR IIR stands for “infinite impulse response”. This blur works best for large radius values and for images which are not computer generated. RLE RLE stands for “run-length encoding”. RLE Gaussian Blur is best used on computer-generated images or those with large areas of constant intensity. and also They both ...


4

I just use Powerpoint to make such diagrams and it works great as soon as you're comfortable with its basic primitives. It supports all simple operations like rotation, translation, etc. and recent revisions also have shear and 3D transforms. Examples: Here is an example of a Powerpoint diagram I made for an answer. For more complicated diagrams, ...


4

PostScript+ps2eps+mogrify For the Affine Transformations answer, I wrote a very small postscript program and then saved several copies under different names and edited each one to do each different task: scale, translate, rotate. For example, here's the basic one, ident.ps which does nothing to change the coordinates between the red drawing and the black ...


4

You can of course, as you suggested, map (u, v) to (φ, θ). Unfortunately, it does not solve the problem for 5 points: I've changed Holger Dammertz' code a bit (switched u and v), and you see that the problem still persists. For a higher number of points, it really doesn't seem to make a (visual) difference. The Hammersley point set is a way to very quickly ...


4

It speed does not matter, I suggest to use a truncated sinc or a Lanczos isotropic kernel: to compute a target pixel, you back-rotate the filter and convolve it with the image. Since it is isotropic, it is separable and you can even use a square filter parallel to the axis of the source image.


4

Not the definitive toolbox you might be looking for, but just an extra tool I use myself: for 3d graphics, Blender might come in handy. Especially if you use the Export_SVG plugin (available from http://dl.dropbox.com/u/16486113/Blender/archivos/temp/SVG/export_svg.py and http://blenderartists.org/forum/showthread.php?282824-SVG-output-script ) This allows ...


4

I think that there is a bit of confusion in terminology. My understanding is that only the initially colored points, before step 1, are called seeds. Maybe this helps clarify the algorithm as well. When the a point $ p $ with color $ s $ finds a neighbor $ q $ with color $ s' $, he compares the distance $ d(p,s) $ with $ d(p,s') $ (not $ d(p,q) $) to ...


3

According to a review by Legge & Bigelow the arc or degrees of visual angle ($\alpha$) is, $$ \alpha = 57.3 \times S/D, $$ where S is height of object and D is distance to object. [1] $S/D$ is the small angles approximation of $2 \times arctan(S/2D)$ which follows form geometry. Image 1: the equation comes straight from trigonometric definitions. ...


3

This never writes anything to the output file because you haven't included any code to write to the output file. The only time you touch the file after opening it is in the line png->MakeFromFILE(pFile); which reads from the file into the SkData instance. It won't even do that in this case, because the file handle has to be open for reading only. I'm ...


3

In principle you avoid using scatter (casting) behavior with GPU. They have offered random output coordinate write out since only shader model 5 as a need for extreme situations. But you should as general rule write your GPU code in a "gather" fashion. The difference: the hardware threads are logically soft-locked to one output position in the render target....


3

Edit: This answer is only helpful in 3D If you want to do it geometrically... The inverse of the view-projection matrix, $K^{-1}$ is the matrix you want. Where $K = View * Projection$ If $\vec{v}$ is a point in homogeneous screen coordinates, $[x, y, 1]$ where $x$ and $y$ are whatever coordinates your $K$ matrix projects onto. $$\vec{d} = K^{-1} * \vec{...


3

Given that you want to test for intersection against rays with many different starting points and directions, it's worth investigating raytracing-style acceleration structures, such as the bounding volume hierarchy (BVH). In 2D, this would look like a tree of axis-aligned bounding boxes that divide up the space. Each leaf node of this tree would store a ...


3

Subdivision can be used for curves in 2D just as easily as for surfaces in 3D. Usually the subdivision algorithms applied to 2D are called subdivision curves. Subdivision curves do not suffer from the problem that subdivision surfaces have around extraordinary points and therefore all subdivision surfaces can easily be converted to (uniform) B-splines. This ...


2

You can use OpenGl 4.x tessellation shaders to convert Bezier control points into polygons. A google search for "tessellation shader bezier" found this outline describing the tessellation of Bezier surfaces and curves: http://web.engr.oregonstate.edu/~mjb/cs519/Handouts/tessellation.1pp.pdf This offloads the Bezier evaluation from the CPU to the GPU and ...


2

I would say it’s a weighted set covering problem. In specific, the cost for a set of points is the number of extra pixels in the bounding rectangle of this set. If the number of diff points is small, you can solve this by linear programming. Otherwise, try some approximated algorithms e.g. greedy.


2

You can solve the colors by solving a system of linear equations if you make few assumptions: The alpha of the color wheel is constant (i.e. same for all colors in the wheel) The beige background extends half way through the color wheel, and is constant for top and bottom halves of the image The background in the center is constant for all colors The alpha ...


2

On typical GPUs today it's option B: monitor rotation is done by the video output hardware ("display engine") during scan-out. In addition to rotating/flipping, the display engine can also scale the image within certain limits, do simple color/gamma correction, and even composite multiple image layers ("planes") together, all dynamically during scan-out.


2

What they're using in this game is called an orthographic projection. It is a special type of a projection, which does not bend objects, it does not mean that they are not using 3D. Now, of course you can achieve this kind of effect using 2D coordinates only if you want. But it requires some mathematical understanding of the situation, as you need to do 3D ...


2

There is some information about the XML file format used for .flame files. There are a number of forks of this program written in different languages, the original site is by definition the place to go for answers; unless you are using a fork - the original seems to have been abandoned years ago. Coefs is 6 floats which defines the coefficients for the ...


2

It comes down to history. The original interfaces for drawing stuff on the screen were for text, not images. Since the people who designed those early computers spoke languages that are read left-to-right, top-to-bottom, it made sense for the first glyph to be the top-left one. This also works conveniently with how the image was transmitted to the display. ...


2

Both T-splines and subdivision surfaces are capable of handling an arbitrary topology input mesh, whereas NURBS can only handle meshes with regular topology. Complex NURBS objects are therefore made out of multiple regular meshes. These meshes are trimmed and fit together to form a single complex object. However, along the trimming lines of the mesh ...


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

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 ...


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