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

Questions tagged [transformations]

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

1
vote
1answer
58 views

preserving z-values during projection?

Consider this figure for projection. There are two equations that give value for the xp and yp coordinates: $x_p=x.\frac{(z_{vp}-z_{prp})}{h}+ x_{prp}.\frac{(z-z_{vp})}{h}$ and $y_p=y.\frac{(z_{vp}...
2
votes
1answer
39 views

What is the equivalent of rotation matrix in Euler angle space for Quaternions?

I have to load a mesh in Blender (which uses Z and Y as up and forward axes), modify it and export it (with setting up and ...
1
vote
1answer
48 views

How to rotate a shape in another 3D software so that the rotation matches with the rotation in Blender?

I import a mesh in Blender, export it with setting axis_forward='-Z', axis_up='Y', import in NVIDIA's FleX, rotate it and store it on disk; I call this mesh ...
0
votes
1answer
39 views

How to compute A and B in projection matrix

I'm trying to compute a projection matrix to transform from view space to NDC with a near clip plane at -1 and far plane at +1. The general form of this matrix (disregarding aspect ratio and focal ...
0
votes
1answer
85 views

How do I derive this transformation

If I had two right handed frames where one has vectors [i, j, k] and another with corresponding vectors [u v w], how would I derive the transform M[i j k] <-- [u v w] when applied to any point P in ...
2
votes
0answers
25 views

How can I register an articulated model to noisy predictions?

Given point sets $Y$ and $M$, I'd like to register articulated $M$ to $Y$ without changing the edge distances of $M$. The point correspondences between $Y$ and $M$ are known and points have a fixed ...
1
vote
0answers
45 views

Deciphering Affine/Projective Transformation Code

I've spent about 2 days trying to understand this piece of code (from here) that applies an affine/projective transformation to an image. I will link bits of the code that I'm struggling to understand ...
2
votes
0answers
42 views

What is wrong with my deformation gradient calculation?

I created two ellipses,$\hspace{150px}$,where the red ellipsis is as the blue one, except translated to the right and rotated by ${30}^{\circ} .$ Using rotation matrix, $$ \left[ \begin{array}{cc} ...
0
votes
3answers
133 views

Rotation of a random unit vector at a point in 3D space by an angle

I have a scenario where I need rotate a vector ( unit vector) at a point in space by an angle along Z-axis. Is it possible to help me to understand a procedure to achieve this. I'm using vb.net ...
1
vote
0answers
34 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
9 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
39 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
537 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
65 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 ...
4
votes
1answer
176 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, ...
1
vote
1answer
145 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
28 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?
1
vote
1answer
91 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
34 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
383 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
95 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
46 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
60 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
59 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
341 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
103 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
94 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
61 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
127 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
199 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
114 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
105 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
91 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
307 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
73 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
1k 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
99 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
44 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
819 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
101 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
633 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
314 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
570 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
117 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
209 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
193 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 ...