Pages

marți, 10 iulie 2012

Chromium B.S.U. with FX5500 NVIDIA video card.

Chromium B.S.U. is an arcade-style, top-scrolling space shooter available on Windows, iPhone, PSP, Mac, Linux and numerous other UNIX-like operating systems.

It is a free software distributed under the Artistic License.

The original version of Chromium B.S.U. was designed in 2000 by Mark B. Allan and released under the Artistic License.

Since then it has received the contribution of numerous people in the open source community.

The gameplay is based on a player who plays the role of hero, shooting their way through a barrage of enemy forces.

The game is similar to 2D top-scrolling space shooters played in arcades.

Source wikipedia

# apt-get install chromium
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  chromium-bsu chromium-bsu-data libglc0 libglpng ttf-uralic
The following NEW packages will be installed:
  chromium chromium-bsu chromium-bsu-data libglc0 libglpng ttf-uralic
0 upgraded, 6 newly installed, 0 to remove and 412 not upgraded.
Need to get 0B/2,152kB of archives.
After this operation, 4,166kB of additional disk space will be used.
Do you want to continue [Y/n]? 

Let's see the game:

luni, 11 iunie 2012

Project Skydive - 3D Engines

Skydive is a game developed as a student project at University of Skövde in Sweden. We are 17 students that for ten weeks together have made this game in Unreal Development Kit. The gameplay mechanics are completely physics based, i.e. the character is really flying. The mountain is super huge (actually 14000 times larger than the Unreal Tournament map dm_deck). The game features several game modes, two characters and splitscreen support for up to four players. The game is a PC game but is played played with an Xbox 360 controller.

On UDK website, we can see this:

If you are using UDK internally within your business and the application created using UDK is not distributed to a third party (i.e., someone who is not your employee or subcontractor), you are required to pay Epic an annual license fee of US$2,500 per installed UDK developer seat per year.

So what is my point.

To make something like this we can use an free and better 3D engine.

Like Ogre 3D, Irrlicht.

Read this if you don't trust in my opinion.

luni, 21 mai 2012

Python , OpenGL and cube map OpenGL ARB

Today I will show a simple script that uses the OpenGL ARB "Architecture Review Board". The result is show in the next image.
I use just one image file named 111.JPG for all cube images. Let's see the python script.

from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
from OpenGL.GL.ARB.texture_cube_map import *
import Image                
import sys
#after I import all module , I set some vars
angle    = 0.1
texture  = 0
#this var set the type of reflection
reflMode = GL_REFLECTION_MAP_ARB
#this load the texture 
def loadTexture ( fileName ):
    image  = Image.open ( fileName )
    width  = image.size [0]
    height = image.size [1]
    image  = image.tostring ( "raw", "RGBX", 0, -1 )
    
    texture = glGenTextures ( 1 )
    glBindTexture     ( GL_TEXTURE_2D, texture )   
    glPixelStorei     ( GL_UNPACK_ALIGNMENT,1 )
    glTexParameterf   ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT )
    glTexParameterf   ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT )
    glTexParameteri   ( GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR )
    glTexParameteri   ( GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR )
    gluBuild2DMipmaps ( GL_TEXTURE_2D, 3, width, height, GL_RGBA, GL_UNSIGNED_BYTE, image )
    
    return texture
#this load a cube map of six images
def loadCubemap ( faces, path = ""  ):
    texture = glGenTextures ( 1 )
    target_map  = GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB
    glBindTexture     ( GL_TEXTURE_CUBE_MAP_ARB, texture )  
    glPixelStorei     ( GL_PACK_ALIGNMENT,1 )
    glTexParameteri   ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S,     GL_REPEAT )
    glTexParameteri   ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T,     GL_REPEAT )
    glTexParameteri   ( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR )
    glTexParameteri   ( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR )
    glEnable          ( GL_TEXTURE_CUBE_MAP_ARB )
       
    for face in faces:
        if path != "":
            file = path + "/" + f
        else:
            file = face
        image  = Image.open ( file )
        width  = image.size [0]
        height = image.size [1]
        image  = image.tostring ( "raw", "RGBX", 0, -1 )
        gluBuild2DMipmaps ( target_map, 3, width, height, GL_RGBA, GL_UNSIGNED_BYTE, image )
        target_map = target_map + 1
    return texture
#this check if is working OpenGL ARB extension 
def extensionInit ():
    if not glInitTextureCubeMapARB ():
        print "ARB_texture_cubemap not working !"
        sys.exit ( 1 )
#this is default init of opengl 
def init ():
    glClearColor ( 1.0, 1.0, 1.0, 0.0 )
    glClearDepth ( 1.0 )                
    glDepthFunc  ( GL_LEQUAL )
    glEnable     ( GL_DEPTH_TEST )
    glHint       ( GL_POLYGON_SMOOTH_HINT,         GL_NICEST )
    glHint       ( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST )
#this help us when resize the window
def reshape ( width, height ):
    glViewport     ( 0, 0, width, height )
    glMatrixMode   ( GL_PROJECTION )
    glLoadIdentity ()
    gluPerspective ( 55.0, float(width)/float (height), 1.0, 60.0 )
    glMatrixMode   ( GL_MODELVIEW )
    glLoadIdentity ()
    gluLookAt      ( 0.0, 6.0, 0.0, 4.0, -4.0, 4.0, 0.0, 0.5, 0.0 )

def display ():
    global texture, reflMode
    
    glClear   ( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT )
    glEnable  ( GL_TEXTURE_CUBE_MAP_ARB )
    glEnable  ( GL_TEXTURE_GEN_S )
    glEnable  ( GL_TEXTURE_GEN_T )
    glEnable  ( GL_TEXTURE_GEN_R )
    glTexGeni ( GL_S, GL_TEXTURE_GEN_MODE, reflMode )
    glTexGeni ( GL_T, GL_TEXTURE_GEN_MODE, reflMode )
    glTexGeni ( GL_R, GL_TEXTURE_GEN_MODE, reflMode )
    
    glBindTexture   ( GL_TEXTURE_CUBE_MAP_ARB, texture )
    glPushMatrix    ()
    glTranslatef    ( 2, 2, 2 )
    glRotatef       ( angle,  0, 10, 0 )
    
    glutSolidTeapot ( 1.5 )
    
    glPopMatrix     ()
    glutSwapBuffers ()
#this test the keyboard
def keyPressed ( *args ):
    global reflMode
    
    key = args [0]
    if key == '\033':
        sys.exit ()
    elif key == 'n' or key == 'N':
        reflMode = GL_NORMAL_MAP_ARB
    elif key == 'r' or key == 'R':
        reflMode = GL_REFLECTION_MAP_ARB
#this will animate , is a idle function
def animate ():
    global angle
    
    angle  = 0.01 * glutGet ( GLUT_ELAPSED_TIME )
   
    glutPostRedisplay ()
#... and the main function
def main ():
    global texture
    
    glutInit               ( sys.argv )
    glutInitDisplayMode    ( GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH )
    glutInitWindowSize     ( 600, 400 )
    glutInitWindowPosition ( 0, 0 )
    
    glutCreateWindow ( "ARB_texture_cubemap demo" )
    glutDisplayFunc  ( display )
    glutIdleFunc     ( animate )
    glutReshapeFunc  ( reshape )
    glutKeyboardFunc ( keyPressed )

    init          ()
    extensionInit ();
    
    texture = loadCubemap ( ( "111.JPG", "111.JPG", "111.JPG", "111.JPG", "111.JPG", "111.JPG" ), "" )
    print texture
    glutMainLoop()

print "Hit ESC key to quit."
main()

luni, 30 aprilie 2012

Overview of Blender 2.63 by blendercookie

This is a new video created by blendercookie about Blender 2.63 features.

Thank you for share us.