Questions tagged [mathematics]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
7
votes
1answer
2k 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+...
3
votes
1answer
251 views

Calculate a rotation around an arbitrary axis

Suppose I have two 3D triangles before & after a single rotation around an unknown axis. How would I go about finding this axis?
4
votes
1answer
174 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 ...
1
vote
1answer
333 views

Beginner CG Research Project [closed]

This summer I will be working with a professor on a research topic of my choice, in the field of graphics & simulation. While my professor is knowledgeable in the area he is being very hands off ...
5
votes
1answer
135 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 ...
2
votes
2answers
365 views

Average point on sphere between 3 other points (spherical triangle)

I am trying to get a normal of a triangle on a sphere, however the normal equations (straight line) give the wrong answer. For the points: $$(-986.786743, -93.348259, -132.439041)\\ (210.731644, -...
1
vote
1answer
43 views

Enter/Exit of unit cube representable as 4 numbers?

In the paper Real-time Reflection using Ray Tracing with Geometry Field , it mentions this: A ray is represented by its two intersection points (in,out) with the bounding box of the surface. ...
4
votes
1answer
132 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?
7
votes
2answers
7k 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 ...
3
votes
3answers
84 views

Does the blending matrix change between calculating various curve segments in a uniform cubic B-splines approximation?

I would like to ask about uniform (periodic) cubic B-splines (approximation, no interpolation). $$B=1/6\begin{bmatrix}-1&3&-3&1\\3&-6&3&0\\-3&0&3&0\\1&4&1&...
4
votes
2answers
131 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 ...
3
votes
1answer
382 views

Rotating an Object Around an Axis

I have a circular shape object, which I want to rotate like a fan along it's own axis. I can change the rotation in any direction i.e. dx, dy, dz using my transformation matrix. The following it's ...
2
votes
0answers
166 views

Transform a centered isosceles trapezoid in a rectangle in 2-D

I must convert a isosceles trapezoid to a rectangle in 2-D with a shearing transformation (or with 2 shearing transformations). The isosceles trapezoid is centered in the origin of axes. It is right ...
1
vote
0answers
83 views

Image cleaning - removing all regular shapes ( circles, squares, text, icons etc. )

I'd like an automatic method to clean images. I've been looking at the GIMP, and its command line (cli) interface, in scheme / lisp. It looks very promising, but I'm a complete novice, so I'd be ...
3
votes
0answers
83 views

What is a good algorithm, and framework, to calculate centres of gravity or mass (cog)?

I'd like to take an photograph, subdivide it into a tesselation, either of squares, or (ideally), hexagons, and then find the centre of gravity (or, if you prefer, centre of mass) of each cell of the ...
13
votes
3answers
3k 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 ...
4
votes
1answer
260 views

Meaning of the parameter in a line-plane intersection in the space

The scenery is the following: I have a polygon in the space, defined (the polygon) from your vertices. By 3 vertices of the polygon (non-aligned) revenue equation of the plane containing the polygon. ...
3
votes
1answer
80 views

Expressing a reflected ray at a point as a function of the incoming ray and the normal to the surface at that point

Said L the incoming ray (at a point $P$). $R$ is the reflected ray. $N$ is the normal to the surface at the point $P$. $\alpha$ is the angle between $N$ and $L$ (and $N$ and $R$ also). It is assumed ...
7
votes
2answers
1k 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 ...
3
votes
1answer
125 views

Fastest way to put a point on the circumference of a circle

My goal is to take a point that is inside of a circle with a given radius and put it on the circumference. Recently I have been normalizing the vector between the point and the center of the circle ...
3
votes
1answer
70 views

How can I draw a tube on basis of position and angle between two 3d points?

I'm struggling with this idea of creating two particles in 3d and draw a tube between them. I can't figure out how to properly set the angle of the tube. I've used two approaches: calculating the ...
3
votes
1answer
617 views

Object rotating around origin instead of object center?

I am implementing simple rotation but the object is not rotating around the local center instead it is rotating around world origin. This is the code: ...
1
vote
1answer
371 views

Why does substracting -1 in shader fail for a float data type?

I am loading a texture in a WebGL fragment shader (GLSL version 1.00). This is my working code: ...
2
votes
1answer
246 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? ...
3
votes
1answer
309 views

Generate this kind of 2d burst or pulse algorithm?

I'm currently trying to develop a game using Cocos2d-x using C++. I really need to generate this burst or (donut-shaped) pulse. I'm having a difficult time how to generate such shape. At first, I was ...
1
vote
0answers
643 views

Line segment intersection test and find the point of intersection

Thanks for the suggestions. Now I am doing it as follows: First off it is identified if two line segments intersect or not. And I am using the algorithm described in the book - "Introduction to ...
8
votes
1answer
210 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 ...
5
votes
1answer
219 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
vote
1answer
935 views

OpenGL C++ Camera Rotation Problem

Currently for a university assignment I have been given a 3D rendering engine, capable of rendering a 3D world. One task is to create a first person camera for it (I know with OpenGL you don't have a ...
4
votes
0answers
54 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 ...
8
votes
1answer
272 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 ...
4
votes
2answers
143 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 ...
7
votes
1answer
467 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 ...
6
votes
2answers
667 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 ...
6
votes
2answers
1k 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 ...
9
votes
2answers
2k 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 ...
1
vote
1answer
622 views

Ray tracing - tangent space for a point on a sphere

In a ray tracer, given a point on a sphere (point_of_intersection with a ray) and its normal for that point (point_of_intersection - center_of_sphere) how do I calculate the tangent space for that ...
2
votes
0answers
57 views

Compute angles and thereby endpoints in a raster grid?

I am at the moment having some issues with computing an endpoint in a raster grid that is also a valid position in a graph. I am trying to draw a line between these two points, but as the point I am ...
5
votes
1answer
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 ...
24
votes
1answer
819 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 ...
11
votes
0answers
623 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 ...
13
votes
1answer
114 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 2
3