Questions tagged [mathematics]

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

Filter by
Sorted by
Tagged with
25 votes
1 answer
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 ...
Vitor's user avatar
  • 353
14 votes
3 answers
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 ...
Thordal's user avatar
  • 141
14 votes
1 answer
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 ...
wip's user avatar
  • 1,861
12 votes
0 answers
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 ...
David Kuri's user avatar
  • 2,293
10 votes
2 answers
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 ...
Martin Ender's user avatar
  • 2,730
9 votes
2 answers
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 ...
videogamechef's user avatar
9 votes
2 answers
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 ...
William Breathitt Gray's user avatar
9 votes
1 answer
5k views

Understanding Jump Flooding Algorithm (JFA) for Voronoi Diagrams

I'm having trouble understanding the JFA. As far as I understood the algorithm, it walks log(n) times through every pixel (no matter if it is a seed or not) and looks at that pixel's neighbors in $(x+...
Muad's user avatar
  • 165
9 votes
1 answer
290 views

Moving each point of a surface in direction of corresponding normal

So let assume that I have some convex smooth and unclosed surface. I'm moving each point of it in a normal direction by some constant factor (This factor is same for all points on surface). Can I ...
Ibraim Ganiev's user avatar
9 votes
1 answer
372 views

Find the longest straight line between two points on surface of polygon

My shape is a slightly concave polygon, and I'd like to know the maximal diameter. I imagine a straight line between two points on the surface of the polygon, such that the line does not pass outside ...
jiggunjer's user avatar
  • 191
8 votes
3 answers
2k views

Does premultiplied alpha give order independent transparency?

I've heard that pre-multiplied alpha gives you order independent transparency but when I sit down and do the math, it doesn't seem to be working. Is that untrue, or am I doing something incorrectly? ...
Alan Wolfe's user avatar
  • 7,801
8 votes
1 answer
845 views

How to invert an affine matrix with small values?

I'm using an affine transformation matrix to transform 2D coordinates from screen (magnitude 10e3) to small parts of fractal sets (magnitude as little as 10e-15). I also need to map the other way ...
solendil's user avatar
  • 251
7 votes
2 answers
917 views

Rotate line around center

I have to use a propriertary graphics-engine for drawing a line. I can rotate the whole drawing by its origin point (P1). What I want, is to rotate it around its center point(M). So basically that it ...
Tofferino's user avatar
7 votes
2 answers
2k views

Estimating real world object distance from photo

I'm not really sure if this is possible but it should be. I currently have a photo of a sphere, whose radius I've measures physically. Knowing the apparent size of the sphere from the photo and all ...
Kronephon's user avatar
  • 243
7 votes
1 answer
195 views

2D sampling with multidimensional transformations

I'm currently learning mathemetical concepts of distribution and the way to use them in a ray tracer with the book "Physically Based Rendering". Let's start by uniformly sampling an hemisphere: As ...
Qzaac's user avatar
  • 73
7 votes
2 answers
2k views

OpenGL with SFML, create an n-pointed star?

Completely stuck on how to do this. Yes, it is a homework problem, but its the first we've had in the class so not too familiar with graphics. Also, seeing as its homework, please don't just give the ...
user2645's user avatar
7 votes
1 answer
696 views

How to match Blenders polynomial lens distortion model with GLSL?

I'm trying to re-implement Blenders (libmv) polynomial lens distortion model using shadertoy, in order to apply the lens distortion in another application ideally by generating a STMap for that. I ...
brockmann's user avatar
6 votes
1 answer
450 views

Logarithmic spiral with equal vertex spacing, what equations?

I need to draw a logarithmic spiral (or close approximation) whose vertices are equally spaced, such that the lines between any two consecutive vertices are of equal length. (Actually, that spiral is ...
Solar Granulation's user avatar
6 votes
1 answer
1k views

Where does the cosine factor comes from in the GGX PDF?

The GGX NDF, as it appears on the paper where it is presented is: $$D(m)=\frac{\alpha_g^2\space\chi^+(m\cdot n)}{\pi\cos^4(\theta_m)(\alpha_g^2+\tan^2(\theta_m))^2}$$ It is equivalent, in the range $...
Sebastián Mestre's user avatar
6 votes
1 answer
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 ...
Joseph Garvin's user avatar
6 votes
1 answer
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 ...
Paul Ferris's user avatar
6 votes
1 answer
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(...
shashack's user avatar
  • 523
6 votes
1 answer
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 ...
user avatar
6 votes
0 answers
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 ...
racz16's user avatar
  • 161
5 votes
1 answer
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 ...
MaT's user avatar
  • 1,229
5 votes
1 answer
106 views

The variance for the Monte Carlo estimator

I was wondering about the variance for Monte Carlo. The book (Advanced Global Illumination 2ed, p.60) writes the equation as follows: $\sigma^2 = \frac{1}{N} \int(\frac{f(x)}{p(x)} - I)^2p(x)dx$ $\...
shashack's user avatar
  • 523
5 votes
1 answer
112 views

Best way to group 3d points into planes, if any

If I have some 3d points, how can I discover parallel planes within them (not just arbitrary planes). I want to know how many "levels" or "floors" something can travel within, after it has done so, ...
ginsunuva's user avatar
  • 123
5 votes
1 answer
161 views

Correct post-displacement normal calculation (Y-component and epsilon)

I often use a 2D Perlin noise texture to displace a grid in the vertex shader (e.g. terrain, ocean). However, every time I google the method to calculate post-displacement normals there is a slight ...
user avatar
5 votes
3 answers
424 views

Visualize the interpolated unit quaternion on the surface of the unit sphere

My major is mechanical, please forgive me for asking questions that may seem trivial to you. First, I'm reading the following paper: Dam, Erik B., Martin Koch, and Martin Lillholm. Quaternions, ...
Ali's user avatar
  • 51
5 votes
1 answer
2k views

Draw angles lines in raster graphics using bresenham line algorithm

I at the moment trying to draw some angled lines using bresenham line algorithm which can circulate a 2d array of size 21x21, as a line angled from 0 - 2pi. So the idea is that the program has to ...
Bob Burt's user avatar
  • 183
4 votes
2 answers
399 views

Why is $pdf(\Psi) = \frac{1}{2\pi}$ when picking from hemisphere uniformly?

I'm trying to figure out why the probability density function for picking a direction uniformly on the hemisphere is $\frac{1}{2\pi}$. Something tells me this is related to the number of steradians ...
PeteUK's user avatar
  • 700
4 votes
1 answer
1k views

GLSL shapes signed distance field implementation explanation?

I'm trying to understand all primitives In this article.After hard work I just learn Sphere and Cube , I wrote description here. I could draw 2D shapes but I have trouble understanding 3D below codes:...
Seyed Morteza Kamali's user avatar
4 votes
2 answers
301 views

Degree for Computer Graphics : Computer Science or Mathematics?

I want to learn graphics on a lower level but I have no clue where to start. I know that I will need some hard mathematics (linear algebra, vectors, matrices, transformations...) rooted inside my head....
Vie Infernal's user avatar
4 votes
1 answer
151 views

How does a rigged model work?

What black magic is behind this? Starting from a pile of polygons, a skeleton, and an initial conformation, how is a new conformation turned into a new pile of polygons?
Praxeolitic's user avatar
4 votes
1 answer
100 views

Understanding distinct vs. not distinct knots in B-splines

In reading the wikipedia page about B-Splines https://en.wikipedia.org/wiki/B-spline, I am getting confused about the concept of knots. If we have a spline of order $n$, with a knot vector ($t_0, \...
IntegrateThis's user avatar
4 votes
1 answer
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, ...
aggregate1166877's user avatar
4 votes
2 answers
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 ...
Nick's user avatar
  • 321
4 votes
1 answer
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 ...
Makogan's user avatar
  • 1,706
4 votes
2 answers
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: ...
sneaker's user avatar
  • 41
4 votes
1 answer
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] ...
Amir's user avatar
  • 241
4 votes
2 answers
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 ...
sajis997's user avatar
  • 1,279
4 votes
1 answer
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...
Amir's user avatar
  • 241
4 votes
1 answer
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 ...
ginsunuva's user avatar
  • 123
4 votes
0 answers
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): ...
user8469759's user avatar
4 votes
2 answers
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 ...
user5884's user avatar
4 votes
0 answers
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 ...
Ibraim Ganiev's user avatar
3 votes
2 answers
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. ...
user8277998's user avatar
3 votes
1 answer
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?
Makogan's user avatar
  • 1,706
3 votes
1 answer
507 views

Determining Rational Quadratic Bezier Curve Weights for Circle

I am trying to create a spherical interpolation with 3 points. I'm currently using Quadratic Bezier Interpolation but have been told I should use Rational Quadratic Bezier Curve in order to get a ...
Dr. Pontchartrain's user avatar
3 votes
1 answer
344 views

Unwinding an image on a spiral to make it long and flat

Here's an odd intellectual puzzle. Something I was daydreaming about on a train - but the maths are somewhat beyond me. How would someone go about un-winding a spiral to produce a long flat image? ...
headbanger's user avatar

1
2 3 4 5