marți, 17 august 2010

NVIDIA PhysX SDK Released

We've all seen these movies. NVIDIA has released the version of the PhysX SDK.
We can use with PhysX Visual Debugger. The SDK is here . But, the development team tells us:
The Free PhysX PC SDK is only available on this website – you will be required to create an account in order to download the Free PhysX PC SDK.

vineri, 13 august 2010

OpenGL and Python - GLSL example

Today I played a bit with GLSL.
Here is the final result in the image below:

The source code used by me:

vertex shader
varying vec3 normal;
void main() {
  normal = gl_NormalMatrix * gl_Normal;
  gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
fragment shader
varying vec3 normal;
void main() {
 float scale = 1.0 / 10.0;
 float frx = fract(gl_FragCoord.x * scale);
 float fry = fract(gl_FragCoord.y * scale);
 gl_FragColor = vec4(frx,fry,0.0,1.0);

joi, 12 august 2010

PyOpenGL - first lines of code.

What is the best way to write first line of code on pyopengl ?
Please see bellow :

Python 2.6.4 (r264:75706, Jun  4 2010, 18:20:16) 
[GCC 4.4.4 20100503 (Red Hat 4.4.4-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from OpenGL import platform
>>> dir(platform)
['CurrentContextIsValid', 'GL', 'GLE', 'GLU', 'GLUT', 'GLUT_GUARD_CALLBACKS', 'GetCurrentContext',
 'OpenGL', 'PLATFORM', 'PlatformPlugin', '__builtins__', '__doc__', '__file__', '__name__', '__package__',
  '__path__', '_load', 'baseplatform', 'copyBaseFunction', 'createBaseFunction', 'createExtensionFunction',
   'ctypesloader', 'getGLUTFontPointer', 'glx', 'os', 'safeGetError', 'sys']
>>> gl=platform.OpenGL
>>> print gl

>>> glCreateShaderObjectARB = gl.glCreateShaderObjectARB
>>> glShaderSourceARB = gl.glShaderSourceARB
As we see , is simple to start it.
Just use gl.function_opengl.
See later.

duminică, 1 august 2010