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.
250 questions
0
votes
0
answers
80
views
Projecting 3D gaussian's transform matrix to a 2D viewspace transform matrix
Essentially I'm wanting to project:
A 3D transformation matrix of a Gaussian (or in this case for simplicity a unit sphere) that includes scale, rotation and translation in world space TO
A 2D ...
1
vote
1
answer
703
views
Why don't more top-down 3D games use an oblique projection, instead of tilting their models and sprites?
I'm making a 2D game in Unity that is set-up in 3D similarly to Enter the Gungeon, where I have an orthographic camera rotated 45 degrees. This makes sprites look wrong and I've seen two main ways to ...
0
votes
0
answers
117
views
How to project textures on to the mesh and overlap them like in Let’s Play Pottery?
I want to learn how to project textures on to the mesh and overlap them like in Let’s Play Pottery. I have an idea for game. I created Models, 3d viewer but I can’t figure out how to implement texture ...
0
votes
1
answer
92
views
Problem with 2D projection
I have a green circle:
Inside the circle, the white frame moves to wherever P, the projection of the targets 3D position into a 2D point, is.
However, outside the circle, the frame will move to the ...
0
votes
1
answer
124
views
Diagonal directions for cuboid in 3/4 axonometric rpg view
In pixel art, how can I construct the diagonal directions for this cuboid?
The goal is to create an 8 directional turnaround for a 2D top-down game.
I am using the 3/4 rpg view, made popular through ...
0
votes
0
answers
138
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:
...
0
votes
1
answer
180
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
0
answers
52
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 ...
2
votes
1
answer
453
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 ...
2
votes
0
answers
138
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 ...
0
votes
1
answer
917
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:
...
0
votes
1
answer
1k
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 ...
0
votes
0
answers
79
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:
...
0
votes
1
answer
238
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 ...
0
votes
2
answers
256
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 (...
1
vote
2
answers
455
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 ...
1
vote
1
answer
175
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
1
answer
1k
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:
...
13
votes
2
answers
5k
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 ...
0
votes
1
answer
82
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
1
answer
623
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 ...
0
votes
1
answer
150
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....
0
votes
1
answer
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 ...
0
votes
5
answers
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 ...
0
votes
1
answer
105
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 ...
1
vote
1
answer
151
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 ...
1
vote
2
answers
900
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 ...
1
vote
0
answers
89
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 ...
0
votes
1
answer
446
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 ...
0
votes
1
answer
235
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 ...
2
votes
2
answers
1k
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 ...
-1
votes
1
answer
281
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. ...
0
votes
1
answer
432
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 ...
-1
votes
2
answers
463
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 ...
0
votes
1
answer
112
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 ...
3
votes
0
answers
2k
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 ...
1
vote
0
answers
65
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 ...
1
vote
0
answers
129
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 ...
2
votes
0
answers
327
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 ...
1
vote
0
answers
38
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 ...
8
votes
4
answers
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
vote
1
answer
252
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 ...
0
votes
1
answer
332
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 ...
0
votes
1
answer
709
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
...
3
votes
2
answers
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
1
answer
2k
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 ...
0
votes
1
answer
479
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 ...
0
votes
1
answer
478
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 ...
0
votes
0
answers
669
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 ...
3
votes
2
answers
2k
views
How to render a field of view of over 180 degrees?
In most 3D renderings, a view frustum is used.
This has the problem, that things get stretched out towards the edges.
At "normal" fov (field of view) of about 60 degrees, the effect is not ...