DOS Games Message Board
DOS Games Discussion
A message board to talk about DOS games, get help, and find old games.
Do NOT post warez or abandonware requests please
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Qbasic4.5 Codes 04: 3D to 2D Conversion. [My year 2000 opin]

 
Post new topic   Reply to topic    DOS Games Discussion Forum Index -> Game Creation
Author Message
NeonAmd64
Experienced Member
Experienced Member


Offline
Joined: 20 Mar 2006
Posts: 84
Location: Next to you, if not then who

PostPosted: Fri Apr 14, 2006 11:48 am     Post subject: Qbasic4.5 Codes 04: 3D to 2D Conversion. [My year 2000 opin] Reply with quote

Fact: All 3D worlds are based on division: without it the 3D worlds will be no longer exist. Cool

Description: The code will convert 3D basic parameters into a 2D basic position.

Caution: Forbidding
The code will acquire you to specify the perspective [angle] of the lens.[Default Value is 220 or 1024]
This will only convert 3D into 2D without drawing anything.

Here is the code:
This will make the arrays and the variables that are required:
Code:
DIM SHARED Xrotate!, Yrotate!, Zrotate!
DIM SHARED Perspective%
DIM SHARED X.scene%, Y.scene%, Z.scene%
DIM SHARED X2D!, Y2D!
DIM SHARED ScreenOffX!, ScreenOffY!


This is the code:
Code:
SUB D3D.D2D (X3D!, Y3D!, Z3D!)
X2D! = (((X3D! + X.scene%) * perspective%) / (Z3D! + Z.scene%))+ ScreenOffX!
Y2D! = (((Y3D! + Y.scene%) * perspective%) / (Z3D! + Z.scene%))+ ScreenOffY!
END SUB



Finished...... Happy

It was a very long journey. hehehe Laughing

So If explanation is needed then please standup Laughing .. Nooo.. I am joking.. just ask me. Happy

Like to see some example then goto:
http://neonamd64.atspace.com/qbas.html
Back to top
Display posts from previous:   
Post new topic   Reply to topic    DOS Games Discussion Forum Index -> Game Creation All times are GMT - 5 Hours
Page 1 of 1

 
Free Windows games


Powered by phpBB © 2001, 2005 phpBB Group and Ask an Expert
Also powered by Darren and the other admin and mods' hard work! ;)