Questions tagged [mathematics]

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

187 questions
25
votes
1 answer

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 different from the 2d plot using the image…
Vitor
  • 353
  • 2
  • 4
14
votes
3 answers

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 like in each mention or explanation of this model a…
Thordal
  • 141
  • 1
  • 5
14
votes
1 answer

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 are used. It seems that the reference most often…
wip
  • 1,809
  • 1
  • 12
  • 26
12
votes
0 answers

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 calculate in floating point precision and not clamp any…
David Kuri
  • 2,293
  • 11
  • 31
10
votes
2 answers

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 permutation table is just a permutation of the…
Martin Ender
  • 2,700
  • 4
  • 22
  • 45
9
votes
2 answers

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 conceptually that the near plane is essentially the…
9
votes
1 answer

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+i, y+j)$ where $i,j \in \{-step\ length, 0, step\…
Muad
  • 165
  • 1
  • 7
9
votes
2 answers

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 what conditions? All I know about Euler angles is…
Ankit singh kushwah
  • 791
  • 1
  • 5
  • 19
9
votes
1 answer

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 the polygon. Is there a general algorithm for…
jiggunjer
  • 191
  • 3
9
votes
1 answer

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 replace this operation by Uniform or Non-uniform…
Ibraim Ganiev
  • 393
  • 1
  • 5
8
votes
3 answers

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? The formula I'm using is: $out_{rgba} = in_{rgba}…
Alan Wolfe
  • 7,711
  • 3
  • 29
  • 72
8
votes
1 answer

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 round, so I simply invert the matrix. It works when…
7
votes
1 answer

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 think I'm close, but when passing the same values…
7
votes
1 answer

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 you probably know, a way to generate the uniformly…
Qzaac
  • 73
  • 5
7
votes
2 answers

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 internal camera parameters is it possible to…
Kronephon
  • 243
  • 1
  • 6
1
2 3
12 13