Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

Transformations are mathematical operations that can be applied to an object to change its scale, position and orientation.

1
vote
0answers
28 views

How to apply scale, translate, rotate with different origin and get new rectangle coordinates

I was reading other questions in this topic but I couldn't apply any viable solution to solve my use case. I have a crop area described with two dimensions (cropWidth, cropHeight) I can easly compute ...
0
votes
0answers
31 views

Dragging an object on a plane with respect to the camera

this is a long description but I hope the solution is simple: I have a 3D pointCloud with a vtk box (displayed at 0,0,0) and I want to drag the box on the XY plane with my mouse cursor (Zero movement ...
0
votes
0answers
8 views

Stacking vertex rotations around different axes of rotation

I have a binary tree, each node being a vertex with a 3D coordinate. I have to traverse the tree in a way to rotate each child node around an axis going through it's parent. The catch is that every ...
2
votes
1answer
38 views

Correctness or otherwise of the procedure for generating an orbiting camera in WebGl

I have to create a orbiting camera. I created the model of sun (a sphere) around (0,0,0) , triangulated and Phong shaded it. I would have a camera that goes around the sun thus an orbiting camera and ...
1
vote
0answers
107 views

General fixed-point scaling

For general fixed-point scaling problem, If I want to scale twice about a fixed point (x, y), I need to first translate the object so that fixed point coincides with the origin, then do the scaling ...
1
vote
1answer
51 views

Rotating scene or complex object using center of AABB

All objects have two AABB (Axis Aligned Bounding Box), one in local space and one another in world space. The box in local space is calculated while importing scene from external source, and the box ...
3
votes
0answers
83 views

Linear bending of a mesh

I am trying to implement linear bending of a mesh by following what Alan H. Barr explained in his Global and local deformations of solid primitives paper (ACM link, Direct Link hosted on a faculty ...
2
votes
1answer
105 views

Canonical Space to Screen Space: Why do we have the strange -0.5?

When we convert from canonical space to screen space, To map x from -1 to 1 to 0 to width, ...
0
votes
1answer
71 views

Curve rotation in GLSL fragment shader

I'm trying to figure out the correct math to rotate and translate a curve displayed in a fragment shader. What I try to accomplish is to define a curve, for example a sine curve, in a local ...
0
votes
0answers
18 views

Is it possible to calculate center of projection if vanishing point coordinates is given?

Is it possible to calculate center of projection if vanishing point coordinates is given? Suppose vanishing point given is (0, 0, -5) what could be center of projection? Will it take same value?
0
votes
0answers
44 views

What is the difference between standard and non standard perspective projection?

Recently I saw this question: What is the difference between standard and non standard perspective projection? i know one point, two point , three point perspective projection but never heard of ...
1
vote
1answer
46 views

How do I build my tangent space matrix?

I'd like to understand how the process of building the "tangent space" matrix for normal mapping works. I'm following several tutorials, and other stackexchange questions, but I'm unfamiliar with the ...
0
votes
0answers
28 views

Quaternions and intersection bugs for boxy SDFs

I'm using ray-marching to render simple shapes and test different mapping functions; rotating the shapes along a path lets me easily see all of each surface without clicking/dragging. Rendering boxes ...
1
vote
0answers
30 views

Transform a cube in a truncated pyramid

I have to calculate the modeling transformation that transforms a cube of side=1 centered in (0,0,0) in a rectangular truncated pyramid of height=2,sides of basic rectangle equals to 3 and 2, sides of ...
3
votes
1answer
254 views

Ray tracing: transforming ray to object's local space for intersection test

Im writting a raytracer, for which I want to be able to test intersections with implicit surfaces (in my case spheres). Without applying any transformation it works great, but I would like to upgrade ...
1
vote
1answer
82 views

What is the algorithm used in pbrt-v3 for triangle intersection?

Where's this algorithm come from? Any references? And a specific question, when the authors compute the transformation from world space to ray-triangle intersection coordinate space, what's the ...
1
vote
0answers
44 views

Tanget plane of an image

My problem is about tangent plane. I have an image (m by n). I obtain surface normal vector using machine learning methods. Then i would like to obtain tangent plane for this surface normal. To ...
1
vote
1answer
54 views

Back and forth rotation on Y-axis

I want to write code for a cube rotating 10 degrees back and forth on its y-axis in an OpenGL application. Right now I have this written in my display method, however it depends on processor speed, ...
2
votes
1answer
58 views

Do normals in obj files have to be changed into eye coordinate before being used?

Obj files give pre-calculated normals which are in model coordinates. So I wonder if they have to be transformed into eye coordinate (where I use them to calculate lighting)? I'm thinking yes because ...
2
votes
1answer
189 views

Why does this gl_FragDepth calculation work?

I am raytracing in GLSL. My gl_FragDepth calculation wasn't right, so I did some hunting and found this solution (P is the world-...
1
vote
2answers
100 views

Is there something wrong with a column camera matrix?

I am writing a simple ray tracer. I was working on my camera matrix when I encountered a problem. When I changed the look vector, so that it headed down, the image, which was supposed to go up, ...
1
vote
1answer
75 views

What technique would I use to create fake 3d walls as seen in Realm of the Mad God

I wanted to make a little demo for a console with Realm of the Mad God esc graphics to brush up my C and SDL skills. One problem I'm running in to is creating the 3D walls. The console I'm ...
1
vote
1answer
60 views

Image warping using pixel normals

I want to insert a logo into an RGB image with proper 3D transformations. I can get the estimated pixel normals of this image using the code here: https://github.com/yindaz/surface_normal. Pixel ...
1
vote
0answers
94 views

Octahedral mapping for Spherical functions

I guess most of you are familiar with environment maps, they represent distant lighting distribution, and are used to render objects given their BRDF or SVBRDF distribution. Many papers map the ...
4
votes
1answer
106 views

why is translating in 3D space the same as shearing in 4D space?

I was reading "3D Math Primer for Computer Graphics and Game Development" and there was something the author had said that I thought was particularly interesting, he stated It is important to ...
4
votes
1answer
85 views

How to obtain generalized barycentric coordinates for n-sided polygon?

Quadrilateral linear basis functions(generalized barycentric coordinates) are defined as: What are the steps to calculate the above functions? Is it possible to obtain basis functions for a 5 sided ...
1
vote
0answers
99 views

Composition of an .obj file

Using an iPhone X, I can get a mesh of the face (using ARFaceGeometry), which I can output as an .obj file using ...
3
votes
1answer
77 views

How to calculate camera distance so that after projective transformation a quad is filling the whole screen

First of all, I'm using OpenGL and GLM. Now, I have a square perpendicular to the z-axis and centered around it. Let's say that it has Z-value (offset along the Z-axis) X. Now, I want to set up a ...
2
votes
2answers
214 views

OpenGL : How to rotate an object around viewing space x-axis

I have an object(cow). This cow was translated and rotated(with arbitrary axis) in the modeling space for several times. And I can't know how much cow is translated or rotated. Only I can obtain is ...
3
votes
2answers
39 views

How to get the length of paths in an given font/character

I wan't create some LED-rope text, using some script font, like the following: For this I need somewhat estimate the needed length of the LED-rope for the given letter (or combinations of letters). ...
4
votes
2answers
71 views

Supporting multiple camera types in a deferred renderer without specializing the shaders or in the shaders

Perspective Camera A (row-major) perspective transformation matrix has the following format: $$\begin{align} \mathrm{T} &= \begin{bmatrix} \mathrm{T}_{00} &0 &0 &0 \\ 0 &\...
3
votes
1answer
717 views

OpenGL : How to translate an object with it's own axis

I'm working with OpenGL to try to rotate / translate my 3d object : a cow. The requirement is simple : If I toggle key 'r'. The cow spinning around and random axis. If I drag the cow with mouse, it ...
3
votes
1answer
97 views

How can I implement GIMP's “Colorize” function?

I have an RGB pixel that I'd like to colorize in my program (I'm using GLSL) very similar to how the GIMP "Colors > Colorize" function works. In my program, I can easily convert between RGB and HSV. ...
1
vote
1answer
43 views

How to rotate an object around any axis if i have just local x and y?

I have just two local axis to rotate a 3D object: X (horizontal) and Y (vertical). How to make from this 2 local axises for example a global Y rotation or a Local Z rotation? What math magic do the ...
6
votes
1answer
278 views

Why do I need to inverse the orientation matrix of a camera to be able to translate it in the direction it is facing?

I've been going over some OpenGL learning resources and one of them is this article: Modern OpenGL 04 - Cameras, Vectors & Input in which the author presents an approach to building a ...
2
votes
0answers
98 views

How is it possible to generate geometries using space folding?

There is a TED presentation, where we see really good looking geometries, which are generated using space folding. I get the general idea, that we start from a basic geometry like a cube, and then ...
3
votes
2answers
464 views

Inverse-Transpose of Vertex Normals

For the past month, I have been learning on my own and writing a little graphics library and am currently working on the transformation of vertex normals to soon support lighting/shading. I understand ...
3
votes
2answers
190 views

How to get camera Right vector when Front vector and WorldUp vector are collinear

Get the title problem when implementing a walkthrough camera. I use normlize(cross(WorldUp, Front)) to get Right vector. And when they are collinear, I get a zero vector. Is there any more robust ...
4
votes
3answers
536 views

Point of view and rotation

Two questions which cross over maths/3D imaging/computer science. I'm trying to describe a point of view of an item in a 3d space and subsequently its rotation in a paper I'm writing. Versions I've ...
3
votes
1answer
115 views

Image resize with pixel accumulation?

I have a grayscale image and want to "resize" it in terms of "pixel concentration". That means I divide the source image x_old * y_old into ...
7
votes
2answers
174 views

Color transform algorithm (that also works on saturation and value/lightness)?

To change particular colors in an image, generally you multiply the RGB by a transformation matrix. Image manipulation programs such as gimp & photoshop have a selective color change function that ...
4
votes
2answers
162 views

Suggested image preprocessing before applying threshold

I am trying to vectorize the contours (skewed rectangle) of the TV in the following original image. My first step is applying threshold. Tried selection of threshold values based on what skimage has ...
4
votes
1answer
77 views

Store 3d coordinates in a 2d image?

How can i store the X,Y,Z vertex points of a mesh into a 2d image, such that reading the image pixel values will correspond to the 3d coordinates? is it possible to just store x, y, values on a grid ...
5
votes
1answer
227 views

Rotation matrix for a 3D object in space

This is the follow-up question from here: Minimum requirements to uniquely represent a 3D object in space Assume I have 3 original points in a 3D object (in 3D space) as ...
4
votes
2answers
210 views

Minimum requirements to uniquely represent a 3D object in space

Let's assume we have a 3D object (in 3D space). We get a single representation vertex from this whole 3D object. Given the fact that the object can be moved and rotated in the space in any direction, ...
1
vote
1answer
59 views

Transformation between aspect ratio

I am trying to measure width of an object in image. The object size is 2D object 15cm X 15cm. When I capture a frame with resolution 1280 X 720 (16:9) I am getting that the object width is 50px. But ...
1
vote
0answers
151 views

Tilting a 3d object to face a camera and have it look like it's spinning on the y axis

I have a scene kit app I'm working on and at a certain point I move the camera under a list of objects and tilt it up to give a star wars type view of them. I then need to pull the objects up one at a ...
3
votes
1answer
30 views

Getting from the default view volume to an image on the screen

I don't completely understand the last part of the MVP matrix (projection). In orthographic projection we simply scale the view volume into the default view volume (+-1 on all axis). In perspective ...
4
votes
0answers
68 views

Calculate Camera parameters and HandEyeCalibration

I'm trying to calculate camera paramters and a hand eye calibration (Transformation from camera to eye (display) coordinates) for rendering on a see-through HMD. I have already calculated a ...
4
votes
1answer
99 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?