# Questions tagged [transformations]

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

207 questions
Filter by
Sorted by
Tagged with
60 views

### What fields should a camera class have?

For a good and scalable project structure, what fields would you add to a camera class, apart from its position and orientation? Should I add the near and far planes? Or should that be global, what ...
• 23
81 views

### Confused with Coordinate Transformations

I'm studying coordinate transformations from the book Fundamentals Of Computer Graphics - Peter Shirley, Steve Marschner The book first shows It then says: "We call this matrix the frame-to-...
• 123
1 vote
43 views

### How to translate screen coordinates of a 3d point as the viewport size changes assuming camera state remains constant?

Okay, so let's say I have a point in 3d. And I have a camera state. That is, I know the camera position, the camera target and the camera up vector. I am using the perspective projection to get the ...
• 121
1 vote
73 views

### Raytracing and transformation

So I'm looking at incorporating instancing to my ray tracer. However what I would like some insight on is what to apply the transformation to?. Most suggest to apply the inverse transformation to the ...
1 vote
75 views

### How bits transformed into graphics?

recently i started studying computer science and computer graphics, and one question really haunts me. Mby someone can explain this. How bit patterns become translated into (for example ) text. I know ...
16 views

### Is it possible to separate or split original images (or videos) from a blend image (or video)

The title says it all. Blended image or video contains multiple image or video blended on top of each other. I am looking for any software or tools that can separate the original images or videos. ...
17 views

### Transformation matrix for non-pinhole/orthographic camera from point correspondences

I have two sets of 4 points each in world space, basically corners in the near plane and far plane of a virtual camera (correspondences known) , and I have the NDC cube stretching from/to [-1,1] in x/...
• 125
1 vote
62 views

### Receiver plane depth bias - matrix explanation / derivation

This source on slide 38 on receiver plane depth bias I can find compute a matrix (Jacobian of screen space uv derivatives) which is used to transform the screen space depth derivatives from screen ...
• 125
1 vote
49 views

### Can an aspect ratio be shortened to one value, best practise

I want to make a program that, for starters, list all image files in a folder and writes a warning if one dimension is (i.e.) double (2x) the other dimension, regardless of "image orientation&...
172 views

261 views

### Difference between 2D and 3D pipeline

2D transformation and viewing: The camera projects the 2D world co-ordinate $(x_w, y_w)$ on its projection plane which co-ordinates $(x_v, y_v)$. 3D transformation and viewing: The camera projects the ...
55 views

### How to Achieve Radial Rendering

I'm making a POV fan and would like to display some simple graphics in real-time on it. I have a working naive solution with OpenGL, but I'm maxing out at 7 fps rending a simple cube on a raspberry pi ...
1 vote
116 views

### Parallel projection is special case of perspective projection

I synchronized with @David k's first and second answer regarding perspective and parallel projection. From the first question I understand that the image on the screen is typically described in ...
157 views

### Difference between transformation and projection? [closed]

We know that world coordinates $(x_w, y_w)$ transform to viewport coordinates $(x_v, y_v)$ which are the physical device coordinates. And during projection, any point $(x, y, z)$ projects to $(x, y)$ ...
1 vote
71 views

### Why shearing coefficients multiplying by y? [closed]

We know that shear is transformation that distorts the shape of the object. Shear relative to X-axis that is $y=0$ line can be written as: $x'=x+sh_x.y, y'=y$ My question is why $sh_x$ is multiplying ...
1k views

### Gimbal lock confusion

I am trying to understand exactly what is happening when Gimbal lock occurs. I have read many explanations now which provide the high-level idea, in that Gimbal lock occurs when two axes are aligned ...
81 views

### How do I perform a perspective transform on a straight line?

I'm trying to make a software renderer, but I want to avoid creating extra triangles with clipping. For this I want to transform lines which compose triangles, instead of individual points. However I'...
• 137
47 views

### Reorder mesh triangles

Good Morning! My problem is: I need to get the vertices of a mesh and send them to a shader. Inside the shader I will reassemble the mesh from its vertices. So far so good, I send the information and ...
28 views

### Efficient algorithm for mesh scale adjustment based on the scale of another mesh

I have a mesh (Mesh-A) with a bounding box of some arbitrary size defined by X,Y,Z scale. In runtime I import another mesh (Mesh-B),which has an overall topology similar to the Mesh-A, but it can have ...
• 239
13 views

### How to get the surface alignment

How can I get the surface alignment of a 3D object in screen space? I found this example which, I believe, is aligning the UV coordinates to the 3D vectors (which are determined by their current ...
1 vote
42 views

### Proprietary 3D Format Reverse Engineering: What Could These Numbers And Matrices Represent?

I'm trying to reverse engineer a model format from an older Russian game (Pathologic) with limited success. It is a proprietary model format not recognized by any converters/editing tools (believe me, ...
• 11
138 views

### Why perspective division ( div by w) when applying the inverse to a perspective transformation?

For example, when you want to compute the world space position of a fragment in the fragment shader, you can construct the fragment's NDC coordinates, then multiply by the inverse of whatever ...
• 125
98 views

### Simulate projection matrix deformation in two camera setup

For educational purposes I'm trying to simulate what a scene would look like with a perspective matrix deformation (before everything is brought to NDC) but I'm unsure how to do this. I'd like to do ...
89 views

### How compute new camera parameters given a velocity vector?

My goal is to update camera parameters given a velocity vector so that the camera points in the direction of the velocity vector. How should one compute the update matrix for the camera parameters?
• 241
1 vote
155 views

### What is this graphical effect called?

I was watching this trailer: https://www.youtube.com/watch?v=pWh5388AEHw and at 1:22, the player used a magic trick that created a sphere that warped the projection of the scene. Does anyone know ...
• 113
1 vote
93 views

### How to use trackball for rotating an camera matrix in eye frame

I have a QOpenGLWidget where I use camera transformation matrix(4,4), FOV and vectors Position(4), Up(4), Forward(4). I also have an ArcBall which I can use. I managed to implement zoom and pan by ...
• 111
1 vote
66 views

### Why is browser-resized image crispy and manually-resized image blurry?

I've come across this problem several times now and I can't really understand what causes it; my background is in Wordpress, not really in computer graphics. I hope this is the right place to ask, I ...
• 113
90 views

### Path tracing: How to ensure we are sampling a direction vector within the visible hemisphere of a surface?

Given a surface Normal vector of an intersection point, how can one generate a random direction vector that is guaranteed to be in the visible hemisphere? The way I ...
• 241
374 views

### Transforming a ray from camera space to world space

I am writing a Raytracer and generating rays from the camera. I have a working program but slightly confused about the linear algebra concepts involved in transforming the ray from camera space to ...
133 views

### Rotate a Bitmap with Shearing

I am rotating a bitmap using the three shear algorithm documented in these articles [1][2]. From about 0-90°, the quality is acceptable, but beyond that it gets progressively more distorted until it's ...
44 views

### rotate objects like a trackball

I know how to rotate objects around the center and there are rotation matrices for that as well, but, how do we rotate the object like a trackball, below is the example: firstly I rotate around the y ...
• 117
1 vote
354 views

### Rotating a Bitmap

I would like to rotate an bitmap image using math. I have two issues with my current implementation: the pixel-by-pixel rotation of the copied bitmap is extremely slow and it is leaving gaps between ...
82 views

### Help me understand the derivation of this tangent space to object space matrix

I was trying to follow this http://foundationsofgameenginedev.com/FGED2-sample.pdf But had problem understanding formula 7.33. $$p_i-p_j=(u_i-u_j)\mathrm{t}+(v_i-v_j)\mathrm{b}$$ * $p_i,p_j$ being ...
• 111
45 views

### 3D Bouncing Cube

I'm trying to write a little program with a bouncing cube but I can't find the right x, y, z and angle for it. I have these lines: ...
1 vote
123 views

### Model View Projection Matrix Multiplcation Order

I'm working on a simple software renderer and have a working implementation so far. I'm curious as to why it's actually working since I would expect the multiplication ordering for my world, view and ...
98 views

### Matrix transforming with translation/rotation/scale at center of screen

I'm trying to create a camera using matrix transforms, the gist as follows: ...
734 views

### THREEjs: updating an object's matrix doesnt change it's position and rotation params

I want to set a transformation matrix to an object upon creation and then control it by position, rotation and scale, but while changing the matrix does change the object in world space, it's position ...
47 views

### Could the Tetradic color pattern be expanded to allow /dev/random be "pretty" for cryptographic key purposes?

Is there a way to take a random value (or set of values), and cause them to create a "pretty" pattern (as a thumbprint), and that array of thumbprints might have a rendering mask on just for ...
1 vote
44 views

### What's the name of the transformation that can remove horizontal convergence from a picture?

Say that you are taking pictures from a street like this one: As you can see, the picture is taken perpendicular to the direction of the street. The problem is that cars at the left look as if they ...
• 111
140 views

### Interpolate vertex attributes with $z$ AFTER homogeneous divide

Usually, if we want to interpolate some vertex attributes, say $A_1$, $A_2$ and $A_3$, we have to first divide them by their corresponding $z$ in view space, then we interpolate them using barycentric ...
• 269
191 views

### Transformations and change of basis in CG

Sometimes in CG literature a transformation is equated to a coordinate system change. This is fine as long as the transformation includes only a rotation and a translation. When scaling is involved, ...
• 1,788
1 vote
85 views

### Why does my self-written rendering engine make further away objects look larger?

I am writing a very simple rendering engine. I have already made a few tests, but somehow the images it creates look wrong. Objects that are further away from the camera look larger than objects ...
91 views

### Converting Vertex and Index buffers to a File Format

I have many sets of vertex and index buffers that I’d like to render on to the screen. Ideally each model in different locations with-in world space. I’m actually doing a statistical study on spatial ...
• 113
404 views

### How to keep an object constant in screen space?

If you open the modern Blender UI and select for example scaling, and then you use the scroll wheel to "zoom" (move the camera along the radial axis). You will notice that the size of the 3D widget ...
• 1,447
45 views

### How to transform x-y-z red-green-blue arrows and draw them on 2D screen?

I'm making a raytracer and want to print debug arrows Blender example: Old version of 3d max: How do I do the same having camera forward, up and right vector? I think I need some kind of matrix ...
• 123