# Questions tagged [mathematics]

The knowledge of the numbers, formulas, shapes and quantities. In the computer graphics, almost exclusively linear algebra is being used.

210 questions
Filter by
Sorted by
Tagged with
957 views

### Is my perspective math correct?

I've got a homework in which I have to calculate and plot some points using a pespective transformation, but I'm not sure my results are correct, since the 3d plot using Camera coordinates looks very ...
• 353
5k views

### Correct Specular Term of the Cook-Torrance / Torrance-Sparrow Model

For a while I have been doing some research on the topic of Physically Based Rendering. One reflection model that is mentioned over and over is the Cook-Torrance / Torrance-Sparrow model. It seems ...
• 141
132 views

### Thorough, accessible material about Fourier basis functions and Spherical Harmonics?

Spherical harmonics appear in several computer graphics techniques. I feel that in order to be a better computer graphics developer, I need to have a deep understanding of what they are and how they ...
• 1,861
858 views

### How correct is rendering in XYZ / linear RGB space?

I have a spectral power distribution (SPD, 5 nm steps) for all light sources in the scene and SPDs for the reflectance of all surfaces under any light / viewer angle in question. I'm going to ...
• 2,293
4k views

### What makes a good permutation table?

I'm implementing improved Perlin noise. Its key feature for randomisation is the hardcoded permutation table, which gives essentially random but reproducible gradients at the cells of the grid. The ...
• 2,730
10k views

### How to achieve gimbal lock with Euler angles?

I was studying about Euler angles and I came across the problem gimbal lock which can occur by using Euler angles. In gimbal lock we lose one axis of rotation. But how? And when does it happen? On ...
3k views

### How am I able to perform perspective projection without a near plane?

I'm learning about 3D computer graphics, but I'm having a hard time understanding why the near plane of a viewing frustum can not be placed at z position $0$ (right at the camera). I can understand ...
5k views

2k views

### What does it *mean* to scale in an arbitrary direction?

My graphics text explains rotating along the cardinal axes, then generalizes the math to show how to make a rotation matrix for rotating around an arbitrary vector. That all makes sense and I can both ...
2k views

### Microfacet shading for diffuse materials

I recently replaced the Lambertian BRDF in my path-tracer with Oren-Nayar, under the assumption that I could adjust it to use the GGX distribution model with appropriate masking/shadowing. PBR ...
• 447
134 views

### Monte Carlo Integration

Let $I$ = the value of integration and $p$ = probability distribution. The estimator is denoted as $\left\langle I \right >$ and is \left\langle I \right >=\frac{1}{N}\sum_{i=1}^{N}\frac{f(...
• 523
312 views

### Ray tracing implicit surfaces using Sturm's theorem

I am trying to render implicit surfaces given by a polynomial equation $F(x,y,z) = 0$ using Sturm's theorem. Plugging the parametric ray equation $r(t) = o + td$, where $o\in\mathbb{R}^3$ is the ray ...
868 views

### How to implement PCSS correctly?

I'm trying to implement PCSS in OpenGL/GLSL, but I have problems understanding the details especially the conversions between the coordinate spaces. The existing implementations are so different from ...
• 161
305 views

### Sine-based Tiled Procedural Bump

I am trying to implement this formula to generate bump but I am facing some issue. The result doesn't look the same it's much darker. Here is my result (without same parameters) but it is much darker ...
• 1,229
106 views

449 views

### Shader or formula that distorts inward

I am looking for a shader (or at least the right terminology) for crushing an image. It should be something very similar to barrel distortion, but instead of the center crushing outward to the edges, ...
169 views

### Correctness of logical steps for create the matrix of viewing transformation

In general, I understand the creation of viewing transformation matrix, but I have my doubts. For example, let's say that a world coordinate (called $A$) has a center at $(1,1,1)$, and the view ...
• 321
182 views

### Gradient descent (Not ML) on arbitrary meshes

So I am doing a gradient descent like algorithm on the surface of a mesh and I just noticed something: The above is the geodesic gradient (the distance to a single vertex) Look at where the ear ...
• 1,706
682 views

### Can you explain to me the Bresenham's line algorithm in simple terms?

I've been trying to wrap my head around this algorithm, and I need it for my drawing function. But I can't seem to understand it. The Wikipedia page gives this piece of code right at the end: ...
• 41
415 views

### How to randomly draw Quaternions within a specific range of Euler angles for rotation?

I am pretty new to Quaternions so please bear with me. I want to draw random Quaternion samples so that their Euler angle equivalent would range within [-30, +30] ...
• 241
188 views

### intersection between line segments - narrowed precondition

I believe that the issue may already have been discussed here. I want to find if two line segments does intersect and if they do then find and store and intesection points. Now it is already confirmed ...
• 1,279
13k views

### How to convert Euler angles to Quaternions and get the same Euler angles back from Quaternions?

I am rotating n 3D shape using Euler angles in the order of XYZ meaning that the object is first rotated along the X axis, then Y...
• 241
191 views

### Calculate Transformation between two point sets - but with constrained Degrees of Freedom

How can I calculate the rigid transformation [R|t] between two 3d triangles, but restricted to a given N degrees of freedom (for N = 1..6) ? I know for N=6 I can get a least-squares solution via SVD ...
• 123
282 views

### Pre-filtered environment map, deriving the equation

I'm reading through this article, and more specifically I'm trying to derive the equation that would explain the implementation the following shader (still in the same article): ...
• 556
436 views

### Barycentric coordinates for 5-sided polytope of two triangles and three trapezoids

I have a triangle that is extended in space and each edge is refracted differently, creating a 5 sided polytope. The initial and final triangles are the view radii segments of a frustum. We need to ...
• 53
64 views

### Making surface with common parametrization from bunch of other surfaces

I have bunch of surfaces, like in these two images: Currently to make single surface with common parametrization I sample points uniformly from all source surfaces, and fit single NURBS surface from ...
681 views

### AABB bounding boxes

Here's a constructor to construct a axis-aligned bounding box given two opposite vertices on the bounding box, from Pharr's Physically Based Rendering, Third Edition. ...
• 215
217 views

### How do people come up with subdivision schemes?

Be it chaikin subdivision, loop subdivision, catmull-clark subdivision... How do people come up with the coefficients for an arbitrary subdivision scheme?
• 1,706