Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

3 Dimensional Chat / basic 3D question -- distortion/skew at edge of screen

Author
Message
makdaddy 98102
16
Years of Service
User Offline
Joined: 20th Apr 2008
Location:
Posted: 20th Apr 2008 19:12
I have a basic question about 3D. I have a tiny DarkGDK program in C++ that creates a small sphere and moves it back and forth across the screen (code below).

I notice that as the sphere approaches the left and right edges of the screen, it gets stretched length-wise, so it appears as an oval. My understanding is that this happens because of skewing inherent in the perspective view of the object. But I don't really understand because in real life a sphere does not start to look like an egg as I move it to the edge of my field of view.

In any case, I am trying to understand if there is a way to reduce or eliminate this stretching. I am hoping there is some camera setup/setting or perhaps some global rendering setting that can fix this. I understand that I could fix the problem using sprites, but my application really needs 3D.

Thanks for any help.

the code:

#include "DarkGDK.h"

void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 60 );

dbSetDir( "media" );

dbMakeObjectSphere( 1, (float)0.15, 20, 20 );
dbLoadImage( "media\\red.png", 1, 1 );
dbTextureObject( 1, 1 );
dbSetAmbientLight ( 80 ) ;
float d = 0.01f;

while ( LoopGDK ( ) )
{
if ( dbEscapeKey ( ) )
return;

if ( dbObjectPositionX( 1 ) > 1.5f )
d = -0.01f;
if ( dbObjectPositionX( 1 ) < -1.5f )
d = 0.01f;
dbPositionObject( 1, dbObjectPositionX( 1 ) + d, dbObjectPositionY( 1 ), dbObjectPositionZ( 1 ) );

dbSync ( );
}
}
makdaddy 98102
16
Years of Service
User Offline
Joined: 20th Apr 2008
Location:
Posted: 20th Apr 2008 20:13
After more reading, I realize a simpler way to say all this is: How can I do orthographic projection within the DarkGDK?
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 21st Apr 2008 01:13
Look into the GetCameraInternalData command (or something of like that in the Camera file)

Login to post a reply

Server time is: 2024-11-25 20:19:59
Your offset time is: 2024-11-25 20:19:59