Computer Science Canada

3D space

Author:  shaon [ Fri Apr 11, 2008 8:44 pm ]
Post subject:  3D space

EDIT: correct file has now been uploaded, sorry for the confusion

controls: A = rotate left,
D = rotate right,
W = move forward,
S = move backward,
UP = rotate up,
DOWN = rotate down,
LEFT = rotate the screen by +2 degrees,
RIGHT = rotate the screen by -2 degrees

This is a very simple 3D space program. I'm going to comment it if people ask for commenting, but as of now, I'm just going to post it here anway to be the 2nd person to submit something here.....

Author:  McKenzie [ Sat Apr 12, 2008 1:35 pm ]
Post subject:  Re: 3D space

Great stuff Shaon!
You should mention that you need pygame installed (most should have it anyways), and that the resolution is set insanely high but very easy to change.

Author:  Mackie [ Sat Apr 12, 2008 1:50 pm ]
Post subject:  RE:3D space

That's awesome, you should make a tutorial, or at least a space fighter. Razz

Author:  shaon [ Sat Apr 12, 2008 6:47 pm ]
Post subject:  Re: 3D space

yea, its going to be space fighter, and as for tutorial I found an extremely good site, which describes the calculations needed not just for 3D, but for 2D, texture mapping, etc. I found it to be highly useful, since the person decided to stay away from any programming language and explain the stuff as if though the person wasn't a computer person at all (meaning it is explained in math terms).
Here is the website: http://www.geocities.com/SiliconValley/2151/graphics.html

also how do I change the python file that I uploaded? it says that I can't edit comments which have been replied to, so how do I re-upload the new python file that has a lower res?

Author:  Insectoid [ Thu Jun 19, 2008 1:02 pm ]
Post subject:  RE:3D space

What is this 'pygame' you speak of? I guess the word is derived from the words 'python' ang 'game'?

Author:  Aziz [ Thu Jun 19, 2008 2:00 pm ]
Post subject:  RE:3D space

shaon, speak to Dan about changing uploads I think.

insectoid, http://www.pygame.org/news.html

Also, set the video mode down to 1024x768. Double-clicking the .py brings upon a failing command window that closes before one gets to read:

"
Traceback (most recent call last):
File "U:\3D world\3D world.py", line 10, in <module>
screen = display.set_mode(res,FULLSCREEN)
error: No video mode large enough for 1440x900
"

For others who try to run it, edit line 6 so it reads "res = (1024,768)" instead of "res = (1440,900)". (Or whatever resolution you want).

EDIT: Just ran it, it's quiet fun. I'm going to keep this code for reference, thanks!

Author:  Insectoid [ Thu Jun 19, 2008 2:28 pm ]
Post subject:  RE:3D space

Just tried it- Awesome. Awesome. And just for good measure, Awesome.


: