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()
2D, 3D, game, games, online game, game development, game engine, programming, OpenGL, Open AI, math, graphics, design, graphic, graphics, game development, game engine, programming, web development, web art, web graphic, arts, tutorial, tutorials,
luni, 21 mai 2012
Python , OpenGL and cube map OpenGL ARB
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.
Blender 2.63 - new release
This is the new release of Blender 3D team and it comes with very useful features.
One is Cycles Render Engine and it is still under development is still available since Blender 2.61.
If you use linux OS then requires glibc 2.7, includes Python 3.2 and FFmpeg.
If you want to learn more , try this online manual.
duminică, 29 aprilie 2012
New version of NeoAxis Game Engine
You can read more here.
NeoAxis Group is pleased to announce that new version of its all-purpose 3D game engine NeoAxis 1.2 was released.
New version features numerous enhancements in different areas, including new tools in Map Editor and Resource Editor, extended localization support, ability to directly import new 3D file formats, full support for Intel HD Graphics integrated video cards, new post-processing effects
marți, 17 aprilie 2012
CryENGINE 3 Free SDK
The official website announced:
Anyone can now download a full version of the best All-In-One Game Development Engine, for free and use it without charge for non-commercial game development. You can try out the fastest toolset for creating game worlds and use the power of CryENGINE 3 in your own games
I could not test it because it requires hardware requirements.
The minimum hardware resources are:
• CPU: Intel Core 2 Duo 2GHz, AMD Athlon 64 X2 2GHz or better (a multi-core processor is strongly recommended)
• Memory: 1 GB RAM (2 GB recommended)
• Video Card: nVidia 8800GT 512MB RAM, ATI 3850HD 512MB RAM or better (SM 3.0 minimum)
Bellow is a video, also you can find on internet.
luni, 9 aprilie 2012
New Format Makes Digital Superhero Books More Cinematic
- dialogue box transitions
- blacked-out pages
- cinematic cuts
sâmbătă, 31 martie 2012
News about the game Armagetron Advanced
vineri, 16 martie 2012
Update game : 0 A.D. Alpha 9 Ides of March
Wildfire Games, an international group of volunteer game developers, proudly announces the release of "0 A.D. Alpha 9 Ides of March", the ninth alpha version of 0 A.D., a free, open-source game of ancient warfare. This alpha debuts the Roman faction, new combat and trade systems and more.Top new features in this release:
- The Roman Republic faction, playable on custom scenarios and random map scripts--in single player and multiplayer, complete with a new art set, including new buildings, units, and ships.
- A new combat system that adds bonuses and weaknesses to each unit, like rock-paper-scissors (e.g. spearmen defeat melee cavalry, but are countered by skirmishers and cavalry archers).
- A brand new trading system, over land with traders trained from markets, and over sea with merchant ships built at the dock. Establish a trade route between two markets or docks, and your traders will gain resources for every trip made. You can choose which resource will be gained by a trader.
- Over a dozen new random map scripts by Spahbod, wraitii, and mmayfield45.
- New animations: Rowing oars for ships, rams, some catapults, traders, some animals.
- AI improvements: 0 A.D.'s default AI, qBot, has had a performance increase and had a serious bug fixed with the attack code.
joi, 8 martie 2012
Heaven DX11 Benchmark is Back
UNIGINE Corp. released today an improved version (3.0) of its renown Heaven DX11 Benchmark based on its proprietary UNIGINE™ engine. Great looking as ever and containing many technical improvements, it now runs on Mac and supports for variety of new hardware, including extended support for multi-monitor configurations.
"It's very inspiring that more and more hardware testing professionals as well as tech enthusiasts find Heaven Benchmark useful. Our technology platform is constantly growing and we can bring Heaven Benchmark to new platforms and new hardware", said Denis Shergin, CEO of UNIGINE Corp.
What's New? Added Mac OS X version compatible with 10.7+ (no tessellation). Added support for Intel HD 3000 GPU (no tessellation). Improved support for multi-monitor configurations. Added support for NVIDIA 3D Surround (multi-monitor stereo 3D). Enhanced NVIDIA 3D Vision support. New cross-platform launcher without .NET dependencies. Fixed Phoronix Test Suite compatibility issue. Fixed minor visual artifacts. Improved compatibility with Mesa drivers. Improved detection of new GPUs.
Read more here.
sâmbătă, 3 martie 2012
Microsoft come with the new 3D desktop concept
joi, 23 februarie 2012
BlenderArt Magazine - an inspiration for 3D graphics.
"The magazine was started for the blender community, having the aim of publishing a bi-monthly PDF magazine; free for download. The goal of the magazine is to provide quality learning content for the blender community, from the efforts of the community itself. BlenderArt Magazine is released
The digital magazine WGE:MAG - Issue 3
Hero Engine - Creating the online game
A Comic Book Hero - Diggle talks games
You can download the WGE:MAG from here.
marți, 17 ianuarie 2012
News about NeoAxis Game Engine: The new version 1.11
NeoAxis Group announces that NeoAxis Engine and its SDK was updated to version 1.11. NeoAxis Engine is an all-purpose 3D engine for games development, simulations and visualization systems creation. New version includes fixes for bugs that has been discovered since version 1.1, adds Parallax Occlusion Mapping technology and support for Autodesk 3dsMax Design 2011/2012 in Model Exporter.