![]() |
![]() |
#1 |
<optimized out>
Join Date: Sep 2020
Location: <optimized out>
Posts: 323
|
Perspective projection and long straight lines.
I'm adding ground level scenery into the project I started over lockdown 2.
I'm drawing my first object, a runway, 1.5km long and 30m wide. When doing the standard perspective transform on the four corner points of the runway (positioning my camera a bit above the centre point of that runway), things "work", but the straight edges from corner to corner result in a runway that's "skinny" at the middle. I guess this is to be expected, but I didn't appreciate how severe the effect would be. If I divide the runway up into many segments, calculate and draw them individually, I can get a more realistic runway, but with a side effect that it can appear "bendy" if looking at it from the side. Which is probably actually realistic? So, I think this is how things work, if you're transforming only the vertices and drawing lines between them, then the lines won't be accurate to curves that would happen in real life as the edge passes around and behind you. The thing is, I don't recall ever seeing these effects in the games I used to play, so were they doing something different, or was I just not observant as a teenager? Edit, added two more images, one where the runway is a simple rectangle, trying to get the same angles, and another showing how things start to go wrong - the aircraft and its shadow are no longer centered over the runway. Last edited by Ernst Blofeld; 13 December 2020 at 17:05. |
![]() |
![]() |
#2 |
<optimized out>
Join Date: Sep 2020
Location: <optimized out>
Posts: 323
|
Thanks everyone, I've now got the runway and everything else including shadows drawing correctly without any weird effects.
But now that I can test my code further I have other strange glitches that I really can't be bothered trying to chase down. Will probably go outside instead. Last edited by Ernst Blofeld; 14 December 2020 at 17:36. |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
3D Projection using log and exp. | Jobbo | Coders. Asm / Hardware | 12 | 02 August 2020 18:20 |
Text editor that can edit long lines? | ancalimon | support.Apps | 19 | 19 January 2015 17:36 |
[Found: Gee Bee Air Rally] Biplane game - third person perspective, popping balloons | Abdull | Looking for a game name ? | 3 | 27 February 2010 10:00 |
Perspective | MainCore | support.Other | 2 | 11 October 2006 00:14 |
Towers (Warning, long shot and long post) | Drake1009 | Looking for a game name ? | 2 | 13 May 2005 00:11 |
|
|