# Tag Info

## Hot answers tagged mathematics

12

I would trust Pharr and Humphreys on this. Equation 2 also agrees with the SIGGRAPH Physically Based Rendering course notes, as well as with equation 20 in the Walter et al paper that introduced the GGX distribution. I've read somewhere that there is an error in the original Cook-Torrance paper that led them to miss the factor of 4 in the denominator, which ...

10

The near and far planes of a viewing frustum aren't needed for simple 3D→2D projection. What the near and far planes actually do, in a typical rasterizer setup, is define the range of values for the depth buffer. Depths in the [near, far] range will be mapped into [0, 1] to be stored in the depth buffer. However, the depths aren't simply linearly rescaled. ...

9

Premultiplied alpha itself does not give you order independent transparency, no. This page talks about how it can be used as part of an order independent transparency solution however: http://casual-effects.blogspot.com/2015/03/implemented-weighted-blended-order.html Other benefits of premultiplied alpha include: better mipmaps for textures that contain ...

9

Since a logarithmic spiral is defined by $r=e^{a\cdot\theta}$, the inverse of the equation is this: $\theta=\frac{\ln{r}}{a}$. If we want to be able to control our step value, we can multiply it by a scalar ($a\cdot k$) before taking the logarithm, like so: $\theta=\frac{\ln (ak\cdot r)}{a}$ Therefore, if we take the natural log of theta multiplied ...

8

Identifying your axes in both figures and adding the camera position to your first figure would help you understand what's going on. You could also have a single variables for all your points, generating a 2D matrix with the rows as each point and columns as the components $x$, $y$ and $z$. That way, you could handle the projection using a simple matrix ...

8

As you are taking the mean of a number of sine waves, your colour values will range from -1 to 1. From your example image, it looks like only the top half of this range of values (from 0 to 1) is resulting in colour, with everywhere else remaining black. If whatever you are using to display the result can only handle positive values, then you will need to ...

7

Without seeing the error message I can't be sure but I think it's failing on the 1 being int instead of a float. float inv_coord = v_coord - 1.0; There is a simpler method, you can do 1.0 - v_coord and do away with the abs.

7

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.

7

No this cannot be modelled by (non-uniform) scaling. It's fairly easy to construct a counterexample: The issue is that the amount a section of the curve/surface grows depends on its curvature, not its orientation in space. Notice here that the circular arc grows uniformly in all directions (by a factor of $3/2$) whereas the length of the horizontal segments ...

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

7

Rotations in 3D are normally done with matrices. The xyz Euler angles can be converted to matrices so that it can be used in the rotation. That is where something called rotation order comes in. Basically it says in what order you rotate the object. First you rotate the object around the x axis, then the y axis and lastly the z axis for example. This means ...

7

A gimbal is a pivoted support that allows you to rotate around one axis. Now it so happens that Euler rotations* work like a set of 3 gimbals attached to each other, one rotation builds upon the next (or previous/whole stack if your inclined to model it that way). Image 1: Rotation is like a gimbal. Model using yxz rotation (z=blue, x= red and y=green) in ...

7

When you scale along the X-axis, the X-coordinate (parallel to the axis) gets stretched, while the Y-coordinate (perpendicular to the axis) remains the same. You can think of scaling along an arbitrary axis as stretching along some diagonal. Here's a pic of a square being scaled along the main diagonal (the axis pointing to <1, 1> ) by factors of 2 and 0....

7

You can combine Oren-Nayar with GGX, if your normalize the result. A BRDF is defined by two properties: Helmholtz reciprocity and energy conservation. $f(l_i, l,_o) = f(l_o, l_i)$ $f(l_i, l_o) \leq 1$ Your Oren-Nayar is the diffuse part $f_d(l_i, l_o)$ and your GGX is your specular part $f_s(l_i, l_o)$. If both are energy conserving, then both are at most ...

6

Trick is, to move the entire object so that the point about which you want to rotate is at the center. Then rotate and after that counter move it so that the point is were it was. In fact this is not so much of a trick, as such, nearly all graphics engines work this way. It is just abstracted away in many cases. Most often you will see it done in matrix ...

6

In short; The constructor is correct. As far as I understand, if p1.x is less than p2.x then pMin = p1. So we should only be checking against p1.x and p2.x. I get where the confusion comes from, but the explanation meant something else. It meant that when $p1$ and $p2$ are given, they are not always ordered so that $p1$ is always $pMin$ and $p2$ is ...

6

The subdivision schemes are not arbitrary. Catmull-Clark, arguably the most used subdivision scheme, generalizes bicubic B-splines to meshes of arbitrary topology. Most, other subdivision schemes also generalize other degree B-splines to arbitrary topology. Doo-Sabin for biquadratic B-splines and Loop subdivision generalizes quartic box-splines defined ...

5

A quickly formulated method, read first one that popped in my brain (not best), could be. Find the closest points on a parametric spiral for each sample (read A Pixel Is Not A Little Square3). Then place the samples on a line by placing the pints in one axis by how far they are from your spiral line and the other by what the closest point is. You can then ...

5

The magic is that the mesh is attached to the skeleton. In it's simplest form, this is done by assigning each vertex to a bone. When a vertex is assigned to a bone, that means that it will always keep the same position relative to that bone's position, and orientation (normal, tangent, bitangent aka the bone's local X,Y,Z axis) as the bone moves as ...

5

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

5

It's like this because the surface area of a unit sphere is $4\pi$. As ratchet freak points out, the integral of a probability distribution over its domain has to be 1. Put another way, the probability of choosing some direction is 1. The surface area of the hemisphere is $2\pi$. The constant that you integrate over a $2\pi$ domain to get 1 is $\frac{1}{2\pi}... 5 Actually, it would change if you changed units in the$\textit{pdf}$definition. The fundamental reason is that the$\textit{pdf}$is defined as the probability per steradian. That's what the density part means. You could very well redefine it as the probability per hemisphere and end up with a$\textit{pdf}$of$1$for your example. 5 In this case, the geometry of similar triangles ABC and ADE is used to determine the height of D via the solution of DE. It is obvious that if the near plane is at 0 (AE=0), then a division by 0 occurs -- hence, why the near plane cannot be located at position 0. This is not why the nearZ plane cannot be zero. The goal of perspective math is not to project ... 5 I'm not sure I've correctly understood the question, but here goes. You're trying to sample directions uniformly, so you've got$p(\omega)\$, which is the probability of getting a particular direction. But what is a direction? You actually need your probability distribution to produce numbers in some representation, and the easiest representation to deal ...

5

From the proof of premultiplied alpha blending, there is an assumption that "the operator must respect the associative rule." So, it may lead to confusion of the order of process. Since this is not the commutative rule, blend(a,b) is not same as blend(b,a). Hence, blend(blend(a,b),c) returns same value of blend(a,blend(b,c)). but, blend(blend(a,b),c) does ...

5

Normal distribution functions are defined a bit differently than you might expect. They're not strictly a probability distribution over solid angle; they have to do with the density of microfacets with respect to macro-surface area. The upshot is that they're normalized with an extra cosine factor: $$\int_\Omega D(m) \cos(\theta_m)\, d\omega_m = 1$$ This ...

5

Torus A torus is defined by two parameters: the major radius, and the minor radius. The major radius (t.x) is the radius of the big ring (in red in the diagram), and the minor radius (t.y) is the radius of the circular cross-section. The x and y here are just indices into the vector: they're unrelated to the x and y axes. The left side of the diagram shows ...

4

wil, you largely have enough scholar background, you must have done Fourier and Laplace transforms in second year, and maybe in your engineering school again as part of signal processing classes. If you read "stupid tricks" there is not much more you can do to find a condensed course at this point. The second most famous paper that goes with SH for ...

4

First of all - a number must not occur twice, that is implied since we're talking about permutations. So filling the table with a simple random(255) function won't work. Secondly, you need to ensure that there are no premature recurrence patterns: Consider the values 1,2,3,4 - the permutation table 4,3,2,1 is not a very good one because of its short cyclic ...

4

3D object surface is 2D domain and can thus be parametrized with a 2D function. In case of a unit cube you could parametrize the surface for example by mapping each 6 faces to a 2D image strip. So if you know two points of the ray that intersects the cube, you can define it with 4D function using the parametrization

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