The 2024 Developer Survey results are live! See the results

# Questions tagged [projection]

Projections are several different types of geometrical mapping functions. In 3D, a projection maps three-dimensional points to a two-dimensional plane.

248 questions
Filter by
Sorted by
Tagged with
47 views

### How should I avoid the weird stretching that comes with a projection matrix?

I have an x+ forward matrix defined with the following funciton: ...
• 11
31 views

### Dimetric Screen to World coordinates

I've got a successful projection of world coordinates to the screen, but when I try to generate a ray for screen coordinates to the world, it always generates a fixed point which is invalid. I started ...
• 101
71 views

### When does normalization happen in the perspective projection matrix

I am currently watching this video where the instructor shows how the perspective project matrix is actually derived. There are a few things that I am still unclear of. Firstly he says we need to ...
43 views

### Manual calc of perspective projection and getting point on the screen

I'm need to draw the red rect on the first vertex of gray platform. To begin with, I draw a gray platform with a perspective projection and set it using gluPerspective: ...
90 views

### How do I determine which pixel is under the cursor when looking at an equirectangular image through a camera?

I am working on a game. The camera is freely rotatable by the user. The background is displayed from an equirectangular image. I need to know which pixel of the background image is located under the ...
1 vote
45 views

### How to Generate a Texture to Make an Obstructing Plane Appear Invisible in a 3D Scene?

I have a 3D scene with a camera. Between the camera and the scene, I have a plane with arbitrary orientation. This plane obscures a portion of the scene from the camera’s perspective (anything behind ...
• 111
258 views

### Calculation of far distance plane based on yaw and pitch for a map renderer

I'm working on a vector map renderer. I want to calculate the far plane for a protective transformation, based on the yaw, pitch, roll and height of the camera above the map. Yaw (looking to the left ...
• 123
92 views

### How to correctly rotate 2D orthographic projection around a central point?

I want to rotate a 2D orthographic projection around the centre point of my view. However, something is off (it looks like a translation) but I'm not sure what. To put some concrete values on the ...
• 123
452 views

### Camera Calibration custom Model-View-Projection matrix in Unity?

Coming from this topic I have a Model-View-Projection Matrix obtained from a Camera Calibration method, from where I want to render the scene: ...
540 views

### glm::frustum vs glm::perspectiveFov

When I use glm::perspectiveFov(90.0f,512.0f,512.0f,1.0f,256.0f) I receive a working perspective projection with 90° in both x and y, as seen below (camera is in ...
• 761
280 views

### Implementing Camera Movement and Rotation in 3D Game Engine

Apologies in advance for any mistakes on terminology, I'm really really new to this I'm completely new to 3d (and it's maths) but as a personal exercise I'm doing my own game engine that displays a ...
• 103
46 views

### Perspective projection distortions

I'm building my own engine using python and pygame however my cube model is not able to be displayed correctly. This is my result after applying translation, scaling and projection matrices: ...
147 views

### Perspective projection not working as intended

I copied a perspective projection matrix from here (https://jsantell.com/3d-projection/) and applied it to my vertices. It looks ok but without depth. Rotation matrices also work. When I try to divide ...
127 views

### Hybrid perspective / orthographic projection

I'm trying to figure out how to setup camera projections such that they fulfill following requirements: main scene is rendered with perspective projection camera / viewport controls allow only zoom (...
• 173
1 vote
285 views

### In a 3D projection, how to find 'w' for every y point on the screen

I have a standard 3D rendering pipeline. Let's say I have a camera looking down at a flat plane that represents the floor. (in my game, z = height, so this is a plane where z == 0), and for ...
• 181
1 vote
114 views

### Solving distortion with non-linear scaling in a shader

I am currently working on implementing an older paper in Unity to show the progression of some graphics technologies, and part of that involves sprites being able to cast shadows. A trivial ...
1 vote
936 views

### How to project a Vector3 onto the xz plane?

I have this code that tries to check whether a lobbed grenade will head toward a teammate: ...
• 117
4k views

### How to make backface culling work correctly in both orthographic and perspective projection?

I have a software renderer that I've been building. I just implemented backface culling with the Go code below. This works with Perspective Projection. But I plan to use orthographic projection. When ...
• 243
45 views

### Object stuck to screen no matter what eye position is used

I've run into an issue when trying to write a simple rendering program in D3D11. I'm 90% sure it's to do with some faulty matrix multiplication or generation, but I've tried debugging the values of ...
1 vote
389 views

### D3D12: how to enable perspective correction when interpolating UV coordinates?

Good morning, I am currently running into a UV interpolation issue with D3D12 that looks like this: Is there something that needs to be set when initialising the pipeline so that the GPU does the ...
109 views

### Move player towards screen

I've got a fixed projection perspective camera with a vertical FOV of 70 deg and rotated 45deg on Y axis. Player movement is along Camera's X axis (right/left), Z axis (front/back), Y axis is set to 0....
2k views

### Decal Projector equivalent in unity's standard shader pipeline

I have a script in my Unity project that creates glowing outlines around objects when highlighted in a scene. The shaders don't work properly with the URP or HDRP. However, I want to create a move ...
2k views

### When moving the "camera" should one move the projection matrix or move the world?

I'm making my own game engine as an exercise and I've gotten really confused with what I've read so far. When I want to move my camera do I simply just move the world or move the position of the ...
• 103
65 views

### Matrix math: How to specify camera distance so that an object with a given size is completely visible?

This is my code that draws a top down view tile based map. But Iam do not know how high the camera needs to be placed in the sky so that the map is fully visible so that nothing is cut away and I do ...
• 364
1 vote
105 views

### Determine if a static mesh is lit by directional light

I want to determine if a mesh is lit by the directional light on my scene in editor to automatically disable its "dynamic shadow casting" property (let's say I have one light source in my ...
• 349
1 vote
775 views

### Custom directional shadow map from sun

Due to some material features, I need to create my own directional shadow map. Everything seems to work ok, until the moment where I compare depths. First I add a camera component to the directional ...
• 173
1 vote
72 views

### Fast way to test whether a point is over a 3D mesh

I have a map with islands, and I need to detect whether the player is on an island or not. The player can be flying far above the island, so a fixed-distance raycast is not sufficient, and firing long ...
• 251
358 views

### Planar projection texture mapping algorithm to UV coordinates algorithm explanation

I am using an engine that uses a texture mapper where instead of providing per-vertex UV coordinates a 3D point(P) and 2 vectors(M, N) is provided, the texture coordinates can be directly computed ...
• 119
194 views

### Converting UV coordinates to planar projection algorithm

I'm using an engine that implements a texture mapping technique where the texture map for each triangle is defined by a point(P) and 2 vectors(M, N) instead of per-vertex texture coordinates P defines ...
• 119
718 views

### How to implement cylindrical projection?

This question (and particularly, its answer) talked about how traditional, planar projection matches most monitors... except when it doesn't. Assuming I'm a glutton for punishment, and really, really ...
• 143
191 views

### Drawback of painters algorithm:

We know that to scan convert any polygon first we need to pass any 4 tests of Painter's algorithm. Suppose I have two polygon S1 and S2, which order is S1->S2.we see that all 4 tests are failed. ...
• 117
276 views

### How to visualize angle of projection in Oblique Parallel Projection?

We know that in Oblique Parallel Projection Point (x,y,z) is projected to position (x_p,y_p) on the view plane.Projector (oblique) from (x,y,z) to (x_p,y_p) makes an angle alpha. with the line (L) on ...
• 117
342 views

### 3D image projected to 2D image

We know real world images are 3D.when we projects image from real world this image projects into 2D image where Z component is constant or zero. But when capture the below image which seems to 3D(z ...
• 117
88 views

### Painter's theorem inside and outside test [closed]

I have read from Hearn and Baker computer graphics book. I read the test#2 painter's theorem which image is given below. This image showing surface S is completely behind the surface S', by checking ...
• 117
1k views

### How to project 3D meshes onto a 2D plane producing a 2D polygon silhouette?

I would like to project a number of separate 3D meshes onto a 2D plane and create a 2D polygon representing the outline of all the meshes. I would also like to to create multiple 2D polygons if the ...
• 31
1 vote
54 views

### 3D projection, Similar to SceneCapture2D

I would appreciate some help, I was wondering if it was possible in UE4 to do a "3D projection" of a scene, Similar to what SceneCapture2D does, but the viewer can see a 3D scene (with a ...
• 11
1 vote
108 views

### How to make a multiplayer game for multiple screen sizes?

I am making a 2d multiplayer game for Android, targeted to run on every device. How do I calculate the common position of an asset, independent of screen size? What size map should I assume is a ...
197 views

### Approximate doom/heretic-style freelook distortion with modern graphics APIs

Currently working on a doom-like engine with fewer technical limitations, and looking into rendering techniques. I'm aware doom's a raycaster, and I want to capture a similar look but with modern ...
• 121
1 vote
31 views

### Perspective of a Point Light

I'm trying to calculate shadows by projecting the silhouette of each object seen by the light source. (The shadows are just going to go on planes.) To get each silhouette I take a snapshot from the ...
4k views

### How to determine if a 2D image represents what player sees in 3D game world?

I'm working on a game idea where the player is shown a 2D image (say, a "photo") and the player must find a spot in a 3D world where the view is about equivalent to that photo - not ...
• 1,048
1 vote
199 views

### Find projecting triangle for UV mapping in RuneScape model format

I am using an old Runescape model format, also used by Thief and Quake. In this format, instead of specifying UV coordinates for each vertex ABC, we specify a second trio of vertices PMN. Those ...
• 119
211 views

### Need help projecting 2D projectile motion in 2.5/isometric 2D game

So I’ve been researching this a lot and have hit a road block. I’ve read pretty much every thread on here regarding this and while I understand the concept I don’t understand how to implement it. For ...
623 views

### Convert Global Space 3D Location to Local object space?

I'm trying to find a formula that could convert my 3D global coordinates into local object space. Here are the inputs I have ...
• 103
2k views

### How to project a 3D circle/ellipse to 2D?

The 3D ellipse is represented by its center and the vectors for its major and minor axes and the 2D ellipse by its center, the length of the major and minor axes and the angle between the major axis ...
1 vote
1k views

### How to convert from frag position to UV coordinates when my viewport doesn't cover the screen?

So, I'm implementing SSAO as part of my rendering pipeline using OpenGL/GLSL. It works pretty well when I have a camera that takes up the entire screen. However, when my camera is smaller than the ...
• 123
418 views

### Isometric tiles on wrong positions if the mouse points at a negative world coordinate

I am using this approach: http://clintbellanger.net/articles/isometric_math/ Basically, you can calculate the iso coordinates based on the screen coordinates. What I am doing is, getting the actual ...
• 107
392 views

### Reversing plane projection texture mapping algorithm

I found this algorithm in some old codebase, it takes two triangles from a mesh ABC and PMN, where ABC is the triangle that will be rendered and PMN is an extra triangle that is only used to generate ...
632 views

### Unity custom camera projection only working in scene editor

I've found this article on Gamasutra on a custom camera projection to make 3D look more 2D and decided to implement it to make some gameplay tests. I had to make some changes to make it work on URP(on ...