English Amiga Board


Go Back   English Amiga Board > Creation > Graphics

 
 
Thread Tools
Old 13 December 2020, 16:10   #1
Ernst Blofeld
<optimized out>
 
Ernst Blofeld's Avatar
 
Join Date: Sep 2020
Location: <optimized out>
Posts: 321
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.
Attached Thumbnails
Click image for larger version

Name:	runway.png
Views:	176
Size:	4.5 KB
ID:	69913   Click image for larger version

Name:	simple-rectangle.png
Views:	169
Size:	4.5 KB
ID:	69914   Click image for larger version

Name:	gone-wrong.png
Views:	164
Size:	4.1 KB
ID:	69915  

Last edited by Ernst Blofeld; 13 December 2020 at 17:05.
Ernst Blofeld is offline  
Old 14 December 2020, 16:43   #2
Ernst Blofeld
<optimized out>
 
Ernst Blofeld's Avatar
 
Join Date: Sep 2020
Location: <optimized out>
Posts: 321
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.
Attached Thumbnails
Click image for larger version

Name:	fixed.png
Views:	154
Size:	4.4 KB
ID:	69926  

Last edited by Ernst Blofeld; 14 December 2020 at 17:36.
Ernst Blofeld is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 15:39.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.07834 seconds with 16 queries