pygame is
Python
Simple DirectMedia Layer
 
 
pygame.org is
Site Swing
3d engine

3d engine - v0.1

Peter Nosgoth (nightwishphantom)

Tags:

Description

This is an attempt to write a 3d engine. It is very early in development and is not yet usable. To test it just start the script. You should be seeing a coordinate system and a spinning house. Use the keys WASD to fly around. The up and down arrow keys get you up and down. Use the mouse like in an ego shooter to look around. Although this looks impressive to me as far as it goes the engine has some problems. Try flying through the house, and the house will reappear in front instead of staying behind you. If you look closely enough you will see that the coordinate axes do not cross in one point as they should. To fix that the function conv_3d_to_2d needs to be improved. I would apreciate some help with the math. Another problem is importing pictures. For that a function is needed that can stretch an image to any dimension. (pygame.transform.scale() cannot do that) If you have any comments, ideas or improvements mail me at "e-nomine-deus-ex@web.de". mfg nwp.

Links

Source: http://informatik.archenhold.de/kd5rieger/temp/3d_engine_v0.1.pyw

Screenshot


click to view original size

Releases

3d engine - v0.1 - Jul 9, 2006

Pygame.org account Comments

If you wish to leave a comment with your pygame.org account, please sign in first.

July 31, 2007 12:56am - Broolio - nickname: (broolio)
>The problem is that im using sine, cosine and tangens which makes the positions absolute numbers.

try math.atan2(y,x)
http://en.wikipedia.org/wiki/Atan2
June 13, 2007 9:40am - Justin Drobey - nickname: (ssjnarutovash) - 3/5
The concept looks good, but I get problems (it won't run...). If I try to run the source code that you presented directly, I get the following errors:

mfg nwp.
: command not found
: command not foundw: line 17:
./3d_engine_v0.1.pyw: line 18: import: command not found
from: can't read /var/mail/pygame.locals
from: can't read /var/mail/pygame
'/3d_engine_v0.1.pyw: line 21: syntax error near unexpected token `
'/3d_engine_v0.1.pyw: line 21: `pygame.init()

However, by adding the following line to the top of the source code:

#!/usr/bin/env python

The error I get is the following:

: No such file or directory

Nothing else but that... And the program still does not work... What seems to be the problem?
August 17, 2006 4:30pm - Peter Nosgoth - nickname: (nightwishphantom)
centering the center point?
The problem is that im using sine, cosine and tangens which makes the positions absolute numbers.
August 2, 2006 4:06pm - Anonymous - nickname: () - 2/5
it's an engine, and your scored a two for making it work. i may be wrong, but you may be centering the center point, thus making the camera turn around when you go through the house.
spotlight

 
our projects
pygame.org welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
 
recent releases
Dec 16, 2014


Dec 14, 2014

Dec 9, 2014

Dec 6, 2014

Dec 5, 2014

Dec 3, 2014

Nov 27, 2014


Nov 13, 2014

Nov 11, 2014


... more!
 
for pygame related questions, comments, and suggestions, please see help (lists, irc)