Questions tagged [perspective]

An approximate representation, on a flat surface, of an image as it is seen by the eye.

Filter by
Sorted by
Tagged with
0 votes
0 answers
29 views

Changing the scale of a character and speed to match the perspective of a 2D background while traveling along the Y axis

I am making a 2D point and click game, just for fun. I want to create some sense of perspective, so I am trying to change the scale of the player as he travels along the Y axis. Obviously, the speed ...
ehtio's user avatar
  • 101
0 votes
0 answers
28 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: ...
Zoler1337's user avatar
0 votes
1 answer
92 views

When device is put in landscape mode, a cube in the corner of the screen no longer appears to face forward

I've made a cube in the corner of my screen always face forward: transform.rotation = Quaternion.LookRotation(Vector3.forward); If I hold my iPad upright, in ...
jasmine zhao's user avatar
0 votes
0 answers
56 views

Include camera movement and calculation in the 3D game

I was sent here by softwareengineering.stackexchange.com. I am writing a WinForms .NET application using C#. I use SkiaSharp for drawing for performance reasons. I can already create a cuboid, rotate ...
Birger's user avatar
  • 1
0 votes
0 answers
110 views

Is it okay to combine 2 "perspective genre"?

I've just started making a RPG and I'm thinking about putting 2 kind of "genre" perspective, like having a Top-Down gameplay for the entire storyline and putting a 2D fighter for the battle ...
shigukk's user avatar
-1 votes
2 answers
249 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 ...
S. M.'s user avatar
  • 117
1 vote
0 answers
30 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 ...
pointlightperspective's user avatar
1 vote
1 answer
390 views

Understanding the math behind perspective matrix in OpenGL

I've been trying to figure out the math behind perspective matrix for 2 weeks now but I'm failing badly. I understand the theory behind the perspective matrix but I am not sure how the math works. The ...
student's user avatar
  • 77
0 votes
2 answers
150 views

How to handle player slowness while moving up and down in a Top Down game with angled ortho camera and angled sprite due to stretching of ground?

So i'm making a 2D top down game setup in 3D using tilted Sprites and angled orthographic camera. My camera setup is as shown. In my game I have the floor flat on the X/Z plane with walls/characters ...
Anshul V. Kumar's user avatar
0 votes
1 answer
71 views

Confused about why my projection matrix works

My projection matrix was buggy, I'm not great at mathematics, but I checked it against the the songho tutorial, and the broken one seems correct to me but switching nearplane to farplane seems to ...
eternalNoob's user avatar
9 votes
1 answer
450 views

Möbius effect in Unity

This morning I've seen the following animation on Twitter. It is a kind of Möbius strip effect. It's cool! Isn't it? So I've decided to build something similar using Unity, just for fun. I want to ...
sgmonda's user avatar
  • 241
2 votes
0 answers
75 views

Compute spheres 2D speeds in perspective projected animations

I created two animations that consist of spheres moving in a perspective projected 3D space, which means that the size and speed of the spheres vary with the distance: they increase when they are ...
Kathia's user avatar
  • 121
0 votes
1 answer
550 views

How to place a camera so that it always fits a plane?

I have a plane that can get its scale changed during the game, and I want to make the camera view it completely every time the plane has its scale changed. The only camera is set to perspective ...
silviubogan's user avatar
1 vote
1 answer
60 views

Taking cube from camera space to clip space, error in my math?

watching Ken Joy's Computer Graphics lectures on youtube. One thing I'm confused about is after he gets the cube from the camera space to clip space, from my calculations the cube doesn't look like ...
user132696's user avatar
0 votes
0 answers
918 views

How to make game playable in all mobile screen resolution using Unity Cinemachine with perspective mode?

I want my 2D game to be playable (auto scale) in all screen resolution. I'm using Cinemachine & under "perspective" mode. I found tutorial to change the screen in "orthographic" mode but there is ...
Min's user avatar
  • 1
2 votes
2 answers
3k views

How can you create a side-scrolling beat-em-up perspective in Unreal Engine?

How can I achieve Streets of Rage type of perspective in UE4? By that, I mean having a 2D character that walks "into" the screen, but the character doesn't get smaller or angled in any way. Is there ...
lilKriT's user avatar
  • 426
-1 votes
1 answer
222 views

What is the alternative (new) 3d projection called that solves the stretching / zooming at sides of monitor?

I understand about camera's and projections etc, such that we have distortion and zooming when at the sides of the screen (exacerbated on 21:9 monitors), however a few years ago, in a Unity forum ...
iOSProgrammingIsFun's user avatar
1 vote
0 answers
113 views

How and where to transform a Camera Frustum onto a tilted screen?

In rendering tutorials for perspective projection the assumption is that the rendering surface is perpendicular to the sight line. As shown here: How to accommodate for a screen that is tilted ...
JeffV's user avatar
  • 185
0 votes
2 answers
453 views

How to avoid the cutoff of a Sprite when overlapping in a terrain?

I have a scene where I have a terrain as a PlaneGeometry. And I'm trying to locate a building on it as Sprite. But I'm not able to put that building/sprite centered on the terrain without getting a ...
Enzo's user avatar
  • 115
2 votes
1 answer
3k views

Difference between two perspective projection representations

When researching perspective projections on the web, I've come across two different representations. One is unrelated to OpenGL and the other is strictly associated with it. What is the relation of ...
P. Lance's user avatar
1 vote
1 answer
159 views

3D Perspective issues

My team is currently developing a 3D Sidescroller game and we encountered some issues regarding the whole in-game perspective of the levels. The levels are composed of 3D modeled corridors which are ...
AleksandarG.'s user avatar
0 votes
1 answer
2k views

How can I emulate Diablo 3's Isometric view using Perspective?

Using DX11, SimpleMath I am building a isometric game like Diablo 3 in 3D and I want to use a perspective camera that emulates their top down view. Projection Matrix: ...
Chris's user avatar
  • 3
4 votes
2 answers
3k views

Finding the normals of the planes of a View Frustum

Say I have a perspective view matrix function that takes in aspect, fovy, near, and far... Transforming the view into a frustum. Typical OpenGL stuff, right. But say then, that I would like to find ...
Whiteclaws's user avatar
0 votes
1 answer
3k views

Assigning sprite to a sorting layer through scripting

I have few prefabs with sprites which I want to assign to different sorting layers. How can I do it? I am also wondering if sorting layers matter if I use a perspective camera. Do they?
Random generalist's user avatar
1 vote
2 answers
1k views

How do I get from orthographic to perspective?

I programmed a cube in java and calculated the x y and z position for it's rotation on the x,y and z axis but I'm finding it hard to display the z axis i've been trying to change the distance of the ...
ENR813's user avatar
  • 11
2 votes
1 answer
1k views

Simulating a real camera's perspective projection

I'm trying to simulate a real camera's perspective projection of straight, parallel lines running along the ground (one-point perspective) by mapping the real-world 3D coordinates of the lines to 2D ...
John M.'s user avatar
  • 123
0 votes
2 answers
1k views

How to return the scene view camera to the default view

By the "scene view camera" I don't mean a GameObject with a Camera component, I mean the camera used to draw the Scene ...
max pleaner's user avatar
4 votes
1 answer
2k views

When does OpenGL Perform Perspective Divide

When does OpenGL divide by W? Is this done automatically within the vertex shader? It is my understanding that the vertex shader outputs the final vertex position, so I presume no transformations can ...
Edward's user avatar
  • 63
0 votes
1 answer
200 views

Perspective View using Spritesheets

I am creating a Top-View 2D game. However, the only way i can get a good view of the objects, such as houses, trees, is to make the game in orthographic view. The same way games such as Pokemon games ...
Mr. Leeds's user avatar
0 votes
1 answer
93 views

Are there any math limitations on the near plane in a perspective matrix?

I've noted that if in the perspective camera I put near plane to a low number like 0.000001 and far plane to 1000 my render has ...
nkint's user avatar
  • 941
1 vote
1 answer
87 views

Perspective projection in Open GL

I am trying to convert a 3d point into a 2d point using a perspective projection. I'm new to OpenGL and may not have fully understood how this works. How exactly do I calculate the near and far values?...
Kirit Thadaka's user avatar
1 vote
1 answer
611 views

Strange Light Angles in Unity

I'm quite sure that I'm missing something very simple here, but I'm a complete Unity noob and I absolutely can't figure out what I'm seeing. I'm trying to light a sphere from both sides, ...
Nerrolken's user avatar
  • 174
0 votes
1 answer
470 views

View "distortion" or "stretching" when looking up/down? (Software renderer)

I'm not sure distortion is the right way to describe this. I've uploaded a video to show you guys. Apologies if it's long, but I wanted to show the code as well as posting it here. https://youtu.be/...
vexe's user avatar
  • 332
0 votes
1 answer
103 views

Moving an object extremely close to the camera at a constant speed makes it visually speed up

I have a quad in 3D space (a billboard in the real-world sense) that I want to move close to the camera so the user can inspect it. The quad is defined by the 3D coordinates of its four corners. To ...
Roy T.'s user avatar
  • 10.2k
1 vote
3 answers
2k views

Box2D in 3D space

I am trying to combine a perspective camera with a box2D world using libgdx and I am having some problems getting the two to synch up. I want to do this so I can use 3D models but keep the game in a ...
Andreas Toresäter's user avatar
0 votes
1 answer
96 views

Rendering perspective independent polygons in perspective view

I am creating an editor where I have "grabhandles" that can be dragged to transform a primitive object. My problem is that I can't find the correct solution to show these grabhandles in a perspective ...
Wilds's user avatar
  • 70
1 vote
0 answers
55 views

Asymetric Perspectiv View

I am building a addon component that will show synthesized 3D view of the world (kind of FLIR camera simulation). The problem I am facing is that currently I am using Symmetric Perspective View with ...
Zbychus's user avatar
  • 11
0 votes
2 answers
2k views

glm::perspective isn't working?

So I'm learning how to make games and program, and while trying to setup a projection camera using GLM in GFLW, this line of code refuses to work and I can't figuire out why. The code is in the image ...
Alalayo's user avatar
  • 63
1 vote
0 answers
604 views

LibGDX limit the PerspectiveCamera for a FPS view

I'm using LibGDX and I'm trying to implement a FPS camera into my game. I'm not using the FirstPersonCameraController for multiple reasons: I don't want to touch to roll (only yaw and pitch), with ...
Winter's user avatar
  • 341
1 vote
2 answers
748 views

How to fake a 3d character displacement by sprite scaling in GameMaker?

I want my 2D sprite to become bigger when moving down the screen (closer to the camera), smaller when walking away and to maintain the same size when moving left or right. The scaling along the y ...
SBLux's user avatar
  • 33
3 votes
1 answer
138 views

OpenGL Perspective Issue

I'm trying to troubleshoot a problem with my simple OpenGL test program, which I've written in C. I've written some math routines to do the matrix manipulation, but even after copying known working ...
Brian's user avatar
  • 51
1 vote
1 answer
436 views

Unity - Static Camera Perspective, Walls Obscure Player

Pretty simple and common problem here. The world I'm designing is fully explorable, no invisible walls or tricks. It's presented as a single seamless area, a School complex with 9 buildings, some of ...
hedgehog90's user avatar
2 votes
1 answer
2k views

Converting real-life perspective photos into orthographic view for texture creation

I'm struggling to find software that will enable me to take real life photos and make them "flat" (orthographic) for use in textures. Does anyone know of a reliable way to take perspective ...
Steve's user avatar
  • 123
0 votes
1 answer
1k views

How can I convert an orthographic camera to a perspective camera?

How can calculate perspective camera parameters from orthographic camera parameters (left, right, top, bottom, near, far)? Specifically I don't know how calculate the FOV for a perspective camera ...
SomeGenericNameto_Display's user avatar
1 vote
0 answers
124 views

Perspective correct interpolation of normal values

I'm currently writing a software rasterizer and I'm at the point where I can draw arbitrary triangles with vertex colors and perspective correct texture mapping. I do point and directional lighting by ...
lelgetrekt's user avatar
3 votes
0 answers
448 views

I get weird perspective using GLM where the depth is flipped. Please help

The depth is rendered wrong and I can't figure out why. ...
Tai's user avatar
  • 31
7 votes
1 answer
2k views

Perspective-Correct Texture Mapping

I am working on a small rendering engine for a personal project and I am having issues with the texture mapping part of it. It seems to work for some cases, but not for others. For example, when one ...
neat's user avatar
  • 71
0 votes
2 answers
1k views

OpenGL perspective matrix far plane

The near plane clips at exactly the value I set just fine but instead of clipping at 1000 the far plane clips at 1. Here is the code for the projection matrix: ...
minecraftwarlock's user avatar
1 vote
1 answer
777 views

Replicating a worldspace sphere on screen space

I have quite some struggle with a post processing shader that I'm working on. I use Unity, and I have a shader in which I want to, in screen space as part of post processing, render a sphere that ...
user1291510's user avatar
4 votes
1 answer
149 views

Selecting the closest point in perspective view mode

I'm trying to improve my algorithm for selecting points in perspective view mode (OpenGL/Qt/C++). The current implementation works as follows. The user clicks on a certain ...
Ailurus's user avatar
  • 301