<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>opengl &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/opengl/</link>
	<description>Feed of posts on WordPress.com tagged "opengl"</description>
	<pubDate>Sat, 28 Nov 2009 08:05:33 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[The third dimension and the Web]]></title>
<link>http://bison.wordpress.com/2009/11/25/the-third-dimension-and-the-web/</link>
<pubDate>Wed, 25 Nov 2009 20:04:20 +0000</pubDate>
<dc:creator>bison</dc:creator>
<guid>http://bison.wordpress.com/2009/11/25/the-third-dimension-and-the-web/</guid>
<description><![CDATA[I wanted to do a piece on the webGL before I forget. Since Flash can&#8217;t seem to deliver on the ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I wanted to do a piece on the webGL before I forget. Since Flash can&#8217;t seem to deliver on the promise of 3D acceleration (Adobe in general I think need to start fresh on several applications rather sooner than later) the Mozilla Foundation stepped in. They made a custom implementation called Canvas which took off and became WebGL, currently supported by both Mozilla and WebKit (Microsoft is late to the party of course). While WebGL isn&#8217;t part of any official build yet, both nightly builds of WebKit and Firefox has the functionality. In the case of WebKit you need to compile yourself (easier said than done I might add, but I didn&#8217;t bother too much). With Firefox however one only needs to know which buttons to push.</p>
<p>If someone would like to try it out, there are guides for that out there. What I did was I downloaded the nightly build of Firefox (called Mindfield). In the address bar one simply writes about:config and then scrolls down to the WebGL option and makes it true. Too try it out simply visit the WebGL Spore demo by a Mozilla dev.</p>
<p>After looking through the javascript files I came to the conclusion that you have to implement all the GLU functionality yourself since only standard OpenGL (ES i think) calls are availible. A shame but I bet someone will create a JSGLU soon enough. Also loading resources is really convinient since the broweser takes care of loading (in a separate thread I figure).</p>
<p>WebGL is still at its infancy and there is a lot of work to be done. Also the javascript performance is very crucial for any implementation and thankfully WebKit has really driven the development forward in that particular area. Hopefully someone will get around to making Quake 1 in native javascript with WebGL and get everyone else started. I for one would love to be able to integrate 3D graphics with web applications.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Cube 3D Texture Mapping]]></title>
<link>http://katatunix.wordpress.com/2009/11/25/cube-3d-texture-mapping/</link>
<pubDate>Wed, 25 Nov 2009 06:23:37 +0000</pubDate>
<dc:creator>Katatunix</dc:creator>
<guid>http://katatunix.wordpress.com/2009/11/25/cube-3d-texture-mapping/</guid>
<description><![CDATA[Screenshot Program: Cube 3D Author: Katatunix Language: C/C++ Library: OpenGL Require: Microsoft Vis]]></description>
<content:encoded><![CDATA[Screenshot Program: Cube 3D Author: Katatunix Language: C/C++ Library: OpenGL Require: Microsoft Vis]]></content:encoded>
</item>
<item>
<title><![CDATA[Cazzate galattiche in libertà]]></title>
<link>http://guiodic.wordpress.com/2009/11/24/cazzate-galattiche-in-liberta/</link>
<pubDate>Mon, 23 Nov 2009 23:58:57 +0000</pubDate>
<dc:creator>guiodic</dc:creator>
<guid>http://guiodic.wordpress.com/2009/11/24/cazzate-galattiche-in-liberta/</guid>
<description><![CDATA[non sono sempre scelte economiche e mi spiego meglio con un esempio.io programmo in c# e certe cose ]]></description>
<content:encoded><![CDATA[non sono sempre scelte economiche e mi spiego meglio con un esempio.io programmo in c# e certe cose ]]></content:encoded>
</item>
<item>
<title><![CDATA[Renderer: Textures]]></title>
<link>http://slizerboy.wordpress.com/2009/11/22/renderer-textures/</link>
<pubDate>Sun, 22 Nov 2009 16:53:37 +0000</pubDate>
<dc:creator>Robert Chow</dc:creator>
<guid>http://slizerboy.wordpress.com/2009/11/22/renderer-textures/</guid>
<description><![CDATA[Carrying on with the Renderer library,the next function I decided to implement was textures.  To be ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Carrying on with the Renderer library,the next function I decided to implement was textures.  To be able to render the scene to texture is a major function, and for this library is a must.  It is also a requirement to also be able to use those textures as part of a scene too.  I had not previously used vertex buffer objects with textures either, so it was also a good time to test this out, and make sure it worked.</p>
<p>I decided to demo a similar function to that previously, but also, adding in textures too.  This demo takes the random triangles, renders them to texture, and then redraws another scene, using the textures.</p>
<p style="text-align:center;"><a href="http://slizerboy.wordpress.com/files/2009/11/renderer_-textures.png"><img class="aligncenter size-full wp-image-237" title="Renderer_ Textures" src="http://slizerboy.wordpress.com/files/2009/11/renderer_-textures.png" alt="" width="522" height="522" /></a><em>Renderer: Textures.  This scene is made up of 4 images, using the same texture generated from code very similar to that of the vertex buffer objects demo.</em></p>
<p style="text-align:left;">As you can see, the original scene has been manipulated in a way that it would be hard to recreate the scene displayed without first rendering to texture.  The texture size I used was 128 x 128, as was the viewport for when I first rendered the triangles.  This scene however, is of size 512 x 512.  The original texture is seen in the bottom-right hand corner, and all the other textures have been rotated and resized.  The largest of the textures, bottom-left, is slightly fuzzy &#8211; this is because it is twice the size of the original.</p>
<p style="text-align:left;padding-left:30px;"><em><strong>Renderer API</strong></em></p>
<p style="text-align:left;padding-left:60px;">The way I have implemented the rendering to texture function on the API is not much different to rendering as normal.  It&#8217;s a simple case of:</p>
<p style="text-align:left;padding-left:90px;color:#808000;font-family:Courier;">Renderer.RenderToDeviceContext();</p>
<p style="text-align:left;padding-left:60px;">or</p>
<p style="text-align:left;padding-left:90px;color:#808000;font-family:Courier;">Renderer.RenderToTexture(..<em>params</em>..);</p>
<p style="text-align:left;padding-left:60px;">Technically, rendering to texture will also render to the device context.  The main difference however, is that after rendering to the device context, the render to texture method takes in the parameters given, and will make a simple call to glCopyTexImage2D &#8211; as per normal when a client wishes to render to texture using OpenGL.  To save from code duplication, I have used the decorator pattern &#8211; the render to texture class &#8220;decorates&#8221; the original class.  In doing so, it means that I can set up texturing by first binding a texture, make the original call to render to device context, and then finish off by rendering to the bound texture.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Say hello to OpenGL with Qt Creator]]></title>
<link>http://enbunyk.wordpress.com/2009/11/21/say-hello-to-opengl-with-qt-creator/</link>
<pubDate>Sat, 21 Nov 2009 12:55:03 +0000</pubDate>
<dc:creator>bunyk</dc:creator>
<guid>http://enbunyk.wordpress.com/2009/11/21/say-hello-to-opengl-with-qt-creator/</guid>
<description><![CDATA[I am trying to create some application in Qt Creator with OpenGL rendering. Stadnart example Hello G]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I am trying to create some application in Qt Creator with OpenGL rendering. Stadnart example Hello GL, works fine. But there user interface is created in imperative manner. I want to use visual editor.</p>
<p>So I created GUI project with OpenGL support. It worked fine.<br />
<!--more--><br />
Than I add two files:</p>
<p><strong>glwidget.h</strong></p>
<pre class="brush: cpp;">
#ifndef GLWIDGET_H
#define GLWIDGET_H

#include &#60;QGLWidget&#62;

class myGLWidget : public QGLWidget
{
    Q_OBJECT;
public:
    myGLWidget(QWidget *parent=0);
    ~myGLWidget();
     float rotation;
public slots:
    void setRotation(float a);

protected:
    void initializeGL();
    void resizeGL(int w, int h);
    void PaintGL();
};
#endif // GLWIDGET_H
</pre>
<p><strong>glwidget.cpp</strong></p>
<pre class="brush: cpp;">
#ifndef GLWIDGET_CPP
#define GLWIDGET_CPP

#include &#60;QtGui&#62;
#include &#60;QtOpenGL&#62;
#include &#60;GL/glu.h&#62; // I like perspective projection, and gluLookAt

#include &#34;glwidget.h&#34;

myGLWidget::myGLWidget(QWidget *parent)
            : QGLWidget(parent) // I wander what that mean?
{
    rotation=0;
}

myGLWidget::~myGLWidget()
{
    ;
}
void myGLWidget::initializeGL()
{
    glClearColor(0.0,0.0,0.0,0.0);
}

void myGLWidget::resizeGL(int w,int h)
{
    int side = qMin(w, h);
    glViewport((w - side) / 2, (h - side) / 2, side, side);

    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    gluPerspective(45,w/h,0.01,10);
    glMatrixMode(GL_MODELVIEW);
}

void myGLWidget::setRotation(float a)
{
    rotation=a;
}

void myGLWidget::PaintGL()
{
    glBegin(GL_QUADS);
    glVertex3f(0,0,0);
    glVertex3f(1,0,0);
    glVertex3f(1,1,0);
    glVertex3f(0,1,0);
    glEnd();
}
#endif // GLWIDGET_CPP
</pre>
<p>And when I include glwidget.h in mainwindow.h I get such errors:</p>
<pre class="brush: bash;">
mainwindow.o: In function `myGLWidget':
/home/bunyk/projects/HelloGL/glwidget.cpp:10: multiple definition of `myGLWidget::myGLWidget(QWidget*)'
main.o:/home/bunyk/projects/HelloGL/glwidget.cpp:10: first defined here
mainwindow.o: In function `myGLWidget':
/home/bunyk/projects/HelloGL/glwidget.cpp:10: multiple definition of `myGLWidget::myGLWidget(QWidget*)'
main.o:/home/bunyk/projects/HelloGL/glwidget.cpp:10: first defined here
mainwindow.o: In function `~myGLWidget':
/home/bunyk/projects/HelloGL/glwidget.cpp:16: multiple definition of `myGLWidget::~myGLWidget()'
main.o:/home/bunyk/projects/HelloGL/glwidget.cpp:16: first defined here
mainwindow.o: In function `non-virtual thunk to myGLWidget::~myGLWidget()':
/home/bunyk/projects/HelloGL/glwidget.cpp:19: multiple definition of `non-virtual thunk to myGLWidget::~myGLWidget()'
main.o:/home/bunyk/projects/HelloGL/glwidget.cpp:19: first defined here
mainwindow.o: In function `~myGLWidget':
/home/bunyk/projects/HelloGL/glwidget.cpp:16: multiple definition of `myGLWidget::~myGLWidget()'
main.o:/home/bunyk/projects/HelloGL/glwidget.cpp:16: first defined here
mainwindow.o: In function `non-virtual thunk to myGLWidget::~myGLWidget()':
/home/bunyk/projects/HelloGL/glwidget.cpp:19: multiple definition of `non-virtual thunk to myGLWidget::~myGLWidget()'
main.o:/home/bunyk/projects/HelloGL/glwidget.cpp:19: first defined here
mainwindow.o: In function `~myGLWidget':
/home/bunyk/projects/HelloGL/glwidget.cpp:16: multiple definition of `myGLWidget::~myGLWidget()'
main.o:/home/bunyk/projects/HelloGL/glwidget.cpp:16: first defined here
mainwindow.o: In function `myGLWidget::initializeGL()':
/home/bunyk/projects/HelloGL/glwidget.cpp:21: multiple definition of `myGLWidget::initializeGL()'
main.o:/home/bunyk/projects/HelloGL/glwidget.cpp:21: first defined here
mainwindow.o: In function `myGLWidget::resizeGL(int, int)':
/home/bunyk/projects/HelloGL/glwidget.cpp:26: multiple definition of `myGLWidget::resizeGL(int, int)'
main.o:/home/bunyk/projects/HelloGL/glwidget.cpp:26: first defined here
mainwindow.o: In function `myGLWidget::setRotation(float)':
/home/bunyk/projects/HelloGL/glwidget.cpp:37: multiple definition of `myGLWidget::setRotation(float)'
main.o:/home/bunyk/projects/HelloGL/glwidget.cpp:37: first defined here
mainwindow.o: In function `myGLWidget::PaintGL()':
/home/bunyk/projects/HelloGL/glwidget.cpp:42: multiple definition of `myGLWidget::PaintGL()'
main.o:/home/bunyk/projects/HelloGL/glwidget.cpp:42: first defined here
glwidget.o: In function `myGLWidget':
/home/bunyk/projects/HelloGL/glwidget.cpp:10: multiple definition of `myGLWidget::myGLWidget(QWidget*)'
main.o:/home/bunyk/projects/HelloGL/glwidget.cpp:10: first defined here
glwidget.o: In function `myGLWidget':
/home/bunyk/projects/HelloGL/glwidget.cpp:10: multiple definition of `myGLWidget::myGLWidget(QWidget*)'
main.o:/home/bunyk/projects/HelloGL/glwidget.cpp:10: first defined here
glwidget.o: In function `~myGLWidget':
/home/bunyk/projects/HelloGL/glwidget.cpp:16: multiple definition of `myGLWidget::~myGLWidget()'
main.o:/home/bunyk/projects/HelloGL/glwidget.cpp:16: first defined here
glwidget.o: In function `non-virtual thunk to myGLWidget::~myGLWidget()':
/home/bunyk/projects/HelloGL/glwidget.cpp:19: multiple definition of `non-virtual thunk to myGLWidget::~myGLWidget()'
main.o:/home/bunyk/projects/HelloGL/glwidget.cpp:19: first defined here
glwidget.o: In function `~myGLWidget':
/home/bunyk/projects/HelloGL/glwidget.cpp:16: multiple definition of `myGLWidget::~myGLWidget()'
main.o:/home/bunyk/projects/HelloGL/glwidget.cpp:16: first defined here
glwidget.o: In function `non-virtual thunk to myGLWidget::~myGLWidget()':
/home/bunyk/projects/HelloGL/glwidget.cpp:19: multiple definition of `non-virtual thunk to myGLWidget::~myGLWidget()'
main.o:/home/bunyk/projects/HelloGL/glwidget.cpp:19: first defined here
glwidget.o: In function `~myGLWidget':
/home/bunyk/projects/HelloGL/glwidget.cpp:16: multiple definition of `myGLWidget::~myGLWidget()'
main.o:/home/bunyk/projects/HelloGL/glwidget.cpp:16: first defined here
glwidget.o: In function `myGLWidget::initializeGL()':
/home/bunyk/projects/HelloGL/glwidget.cpp:21: multiple definition of `myGLWidget::initializeGL()'
main.o:/home/bunyk/projects/HelloGL/glwidget.cpp:21: first defined here
glwidget.o: In function `myGLWidget::resizeGL(int, int)':
/home/bunyk/projects/HelloGL/glwidget.cpp:26: multiple definition of `myGLWidget::resizeGL(int, int)'
main.o:/home/bunyk/projects/HelloGL/glwidget.cpp:26: first defined here
glwidget.o: In function `myGLWidget::setRotation(float)':
/home/bunyk/projects/HelloGL/glwidget.cpp:37: multiple definition of `myGLWidget::setRotation(float)'
main.o:/home/bunyk/projects/HelloGL/glwidget.cpp:37: first defined here
glwidget.o: In function `myGLWidget::PaintGL()':
/home/bunyk/projects/HelloGL/glwidget.cpp:42: multiple definition of `myGLWidget::PaintGL()'
main.o:/home/bunyk/projects/HelloGL/glwidget.cpp:42: first defined here
moc_mainwindow.o: In function `myGLWidget':
/home/bunyk/projects/HelloGL/glwidget.cpp:10: multiple definition of `myGLWidget::myGLWidget(QWidget*)'
main.o:/home/bunyk/projects/HelloGL/glwidget.cpp:10: first defined here
moc_mainwindow.o: In function `myGLWidget':
/home/bunyk/projects/HelloGL/glwidget.cpp:10: multiple definition of `myGLWidget::myGLWidget(QWidget*)'
main.o:/home/bunyk/projects/HelloGL/glwidget.cpp:10: first defined here
moc_mainwindow.o: In function `~myGLWidget':
/home/bunyk/projects/HelloGL/glwidget.cpp:16: multiple definition of `myGLWidget::~myGLWidget()'
main.o:/home/bunyk/projects/HelloGL/glwidget.cpp:16: first defined here
moc_mainwindow.o: In function `non-virtual thunk to myGLWidget::~myGLWidget()':
/home/bunyk/projects/HelloGL/glwidget.cpp:19: multiple definition of `non-virtual thunk to myGLWidget::~myGLWidget()'
main.o:/home/bunyk/projects/HelloGL/glwidget.cpp:19: first defined here
moc_mainwindow.o: In function `~myGLWidget':
/home/bunyk/projects/HelloGL/glwidget.cpp:16: multiple definition of `myGLWidget::~myGLWidget()'
main.o:/home/bunyk/projects/HelloGL/glwidget.cpp:16: first defined here
moc_mainwindow.o: In function `non-virtual thunk to myGLWidget::~myGLWidget()':
/home/bunyk/projects/HelloGL/glwidget.cpp:19: multiple definition of `non-virtual thunk to myGLWidget::~myGLWidget()'
main.o:/home/bunyk/projects/HelloGL/glwidget.cpp:19: first defined here
moc_mainwindow.o: In function `~myGLWidget':
/home/bunyk/projects/HelloGL/glwidget.cpp:16: multiple definition of `myGLWidget::~myGLWidget()'
main.o:/home/bunyk/projects/HelloGL/glwidget.cpp:16: first defined here
moc_mainwindow.o: In function `myGLWidget::initializeGL()':
/home/bunyk/projects/HelloGL/glwidget.cpp:21: multiple definition of `myGLWidget::initializeGL()'
main.o:/home/bunyk/projects/HelloGL/glwidget.cpp:21: first defined here
moc_mainwindow.o: In function `myGLWidget::resizeGL(int, int)':
/home/bunyk/projects/HelloGL/glwidget.cpp:26: multiple definition of `myGLWidget::resizeGL(int, int)'
main.o:/home/bunyk/projects/HelloGL/glwidget.cpp:26: first defined here
moc_mainwindow.o: In function `myGLWidget::setRotation(float)':
/home/bunyk/projects/HelloGL/glwidget.cpp:37: multiple definition of `myGLWidget::setRotation(float)'
main.o:/home/bunyk/projects/HelloGL/glwidget.cpp:37: first defined here
moc_mainwindow.o: In function `myGLWidget::PaintGL()':
/home/bunyk/projects/HelloGL/glwidget.cpp:42: multiple definition of `myGLWidget::PaintGL()'
main.o:/home/bunyk/projects/HelloGL/glwidget.cpp:42: first defined here
collect2: ld returned 1 exit status
make: *** [HelloGL] Помилка 1
Exited with code 2.
Error while building project HelloGL
</pre>
<p>write this, and understand that I had included not .h file but .cpp. Asking nobody helps if ask right, doesn&#8217;t it? <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>to be continued&#8230;</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[OpenGL Textured Cube]]></title>
<link>http://krypticprogrammer.wordpress.com/2009/11/19/opengl-textured-cube/</link>
<pubDate>Thu, 19 Nov 2009 14:08:23 +0000</pubDate>
<dc:creator>krypticprogrammer</dc:creator>
<guid>http://krypticprogrammer.wordpress.com/2009/11/19/opengl-textured-cube/</guid>
<description><![CDATA[Right. Just a quick post to say that I&#8217;ve updated my webpage with an extension of an older pro]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Right. Just a quick post to say that I&#8217;ve updated my webpage with an extension of an older programme in OpenGL. The previous programme displayed a cube that could be rotated on its various axis, I made changes so the cube now has a texture on each side. The programme still needs tweaking as three of the sides have a mirrored image of the texture that needs fixing.</p>
<p>The texture class that was created can only take Unsigned TGA files, I knocked up a pretty poor one in GIMP for the purpose of the programme just so I could test that it worked!</p>
<p>You can view the source files and .exe on my webpage <a href="http://iprogrammer-blog.co.uk/portfolio/opengl.html">Here</a></p>
<p>And the Video:</p>
<p><span style='text-align:center; display: block;'><object width='425' height='350'><param name='movie' value='http://www.youtube.com/v/DFgFb8OtXgg&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' /><param name='allowfullscreen' value='true' /><param name='wmode' value='transparent' /><embed src='http://www.youtube.com/v/DFgFb8OtXgg&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' type='application/x-shockwave-flash' allowfullscreen='true' width='425' height='350' wmode='transparent'></embed></object></span></p>
<p>Thanks for reading. Comments appreciated.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Renderer: Vertex Buffer Objects]]></title>
<link>http://slizerboy.wordpress.com/2009/11/19/renderer-vertex-buffer-objects/</link>
<pubDate>Thu, 19 Nov 2009 09:31:28 +0000</pubDate>
<dc:creator>Robert Chow</dc:creator>
<guid>http://slizerboy.wordpress.com/2009/11/19/renderer-vertex-buffer-objects/</guid>
<description><![CDATA[So I&#8217;ve started on the Renderer library, and although this update might be coming a couple of ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>So I&#8217;ve started on the Renderer library, and although this update might be coming a couple of weeks late, there&#8217;s a few demos that I&#8217;ve managed to produce as the library is slowly being developed.  Much of the next few Renderer posts will be short, and will not contain much code &#8211; most of the code I am using I have already explained in earlier posts.</p>
<p>The first stage of Renderer I have incorporated is the use of vertex buffer objects.  This is because it is pretty much the core drawing function I will be using to create shapes drawn on to the screen.  Although this is not clearly shown, the first demo was to initially make sure that these vertex buffer objects work.</p>
<p>Using a blending function to incorporate the alpha values, I have loaded the buffers with several objects &#8211; each a triangle of random position and size, with 3 random colours, one for each vertex.  Even more so, the number of triangles is also random.</p>
<p style="text-align:center;"><a href="http://slizerboy.wordpress.com/files/2009/11/renderer_-vertex-buffer-objects.png"><img class="aligncenter size-full wp-image-232" title="Renderer: Vertex Buffer Objects" src="http://slizerboy.wordpress.com/files/2009/11/renderer_-vertex-buffer-objects.png" alt="" width="615" height="615" /></a><em>Renderer: Vertex Buffer Objects.  The screenshots show the results after loading the buffers with random triangles.</em></p>
<p style="text-align:left;">It might not be the most exciting demo in the world, but at least it shows that my vertex buffer objects work.  As a result of this, I am able to carry on, knowing that the most fundemental part of the Renderer library is in place.  For now.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Work || Academic]]></title>
<link>http://slizerboy.wordpress.com/2009/11/16/work-academic/</link>
<pubDate>Mon, 16 Nov 2009 19:29:26 +0000</pubDate>
<dc:creator>Robert Chow</dc:creator>
<guid>http://slizerboy.wordpress.com/2009/11/16/work-academic/</guid>
<description><![CDATA[So I went into university today, just to say hi to all my friends, and what not, and I managed to ge]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>So I went into university today, just to say hi to all my friends, and what not, and I managed to get dragged into the Advanced Graphics lecture they had.  And I have to say, I did find it all very interesting.</p>
<p>Although I&#8217;m pretty much doing just OpenGL at IGI for now on the graphics side, there is no theory based around the work I am doing.  We (I say that, as if I&#8217;m taking the course, but I&#8217;m blatently not) learnt about surface reflectance, and 3 different models used to calculate how light interact with a particular object.</p>
<p>Without going into too much detail (because I can&#8217;t):</p>
<p style="padding-left:30px;"><strong>Bidirectional Reflectance Distribution Funtcion: </strong>simple reflection from a surface</p>
<p style="padding-left:30px;"><strong>Bidirectional Surface Scattering Reflectance Distribution Function: </strong>﻿subsurface scattering for translucent materials</p>
<p style="padding-left:30px;"><strong>Bidirectional Texture Function: </strong>to simulate self-shadowing/scattering</p>
<p>Very interesting, and very theoretical.</p>
<p>But that&#8217;s the problem.</p>
<p>The majority of academic material learnt during university, college, or school, doesn&#8217;t become relevant in the working world, unless you are doing, for example, a job such as research.  You don&#8217;t need to know the theory, you just need to know how to apply and use it, and the majority of the time, it&#8217;s already done for you.</p>
<p>Take OpenGL for example.  I can&#8217;t say I&#8217;m an expert at OpenGL, and I don&#8217;t think I ever will be.  But in this context of theories, OpenGL takes in parameters to describe the light model.  All the theory I learnt during university,  I don&#8217;t need to know, for OpenGL does all of it for me &#8211; all I need to know is how to use the interface to create the model.  And this annoys me sometimes.</p>
<p>A lot of stuff I learn at university will be very irrelevant when I come to work in a job.  Of what I learn, a lot will be interesting.  Also, a lot, not so.</p>
<p>And I&#8217;ve been battling with myself on whether or not to take a PhD after I graduate.  The University of Manchester, School of Computer Science offer very good scholarships for PhDs, and at this current climate in the economic situation, it might definately be something worth considering.  And maybe doing some research into graphics might be rather ideal for myself.  Okay, I can use that research to create a graphical program that uses the theories of my research, but then where does it go from there?  It may be taught in other universities, but the students don&#8217;t actually need to know how it&#8217;s done &#8211; it&#8217;s already been done for them.  Like every argument, there&#8217;s always a for and an against.</p>
<p>There&#8217;s a PhD open day a week next Wednesday &#8211; although it&#8217;s for entry in September 2010, I guess it wouldn&#8217;t hurt to keep my options open.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Ấn tượng chơi game trên BlackBerry Storm 2]]></title>
<link>http://netvietnam.org/2009/11/16/a%cc%81n-t%c6%b0%c6%a1%cc%a3ng-ch%c6%a1i-game-tren-blackberry-storm-2/</link>
<pubDate>Mon, 16 Nov 2009 07:39:48 +0000</pubDate>
<dc:creator>Nhân Mã</dc:creator>
<guid>http://netvietnam.org/2009/11/16/a%cc%81n-t%c6%b0%c6%a1%cc%a3ng-ch%c6%a1i-game-tren-blackberry-storm-2/</guid>
<description><![CDATA[Một trong những tuyên bố gây ấn tượng nhất tại hội nghị BlackBerry Developer Conference lầ]]></description>
<content:encoded><![CDATA[Một trong những tuyên bố gây ấn tượng nhất tại hội nghị BlackBerry Developer Conference lầ]]></content:encoded>
</item>
<item>
<title><![CDATA[Game Projects]]></title>
<link>http://ltty.wordpress.com/2009/11/13/game-projects/</link>
<pubDate>Fri, 13 Nov 2009 11:23:55 +0000</pubDate>
<dc:creator>L&#039;tty</dc:creator>
<guid>http://ltty.wordpress.com/2009/11/13/game-projects/</guid>
<description><![CDATA[Hey guys, a lot of things are going on at the moment. I am working on a few different gaming project]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Hey guys,</p>
<p>a lot of things are going on at the moment. I am working on a few different gaming projects with some really interesting people.</p>
<p>A first version of my Super Koopa War, where the player fights Goombas, Shyguys and Monty Moles and tries to defeat Super Mario, will be released for J2ME phones in the near future. A few things regarding usability, balancing and game fun are still to do, before the Demo will be released on the bolg. This little game shall serve as tutorial on how to implement a mobile game with a nice architecture (entity system, event system, collision detection, physics and a nice animation concept) in J2ME.</p>

<p style="text-align:left;">Additionally, we are working on a second (top secret) project, either for the iPhone or for the PSP, since we have the PSP DevKit now at University.</p>
<p style="text-align:left;">To provide you guys with new stuff, I posted a new tutorial at the publications section. It is a simple Solar System in 3D. Also a first person camera has been implemented to show how things work in the source code. This example does not use OpenGL functions. Matrices, vectors and calculations are done manually. This should give an impression on what OpenGL does when someone calls gluLookAt() or glRotate(). So camera, transformations and rotations are calculated and applied by hand. Feel free to download the example and play around with it.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Loading PNG and JPG images as textures using Embedded C++]]></title>
<link>http://greengalaxy.wordpress.com/2009/11/13/loading-png-and-jpg-images-as-textures-using-embedded-c/</link>
<pubDate>Fri, 13 Nov 2009 08:28:35 +0000</pubDate>
<dc:creator>greengalaxy</dc:creator>
<guid>http://greengalaxy.wordpress.com/2009/11/13/loading-png-and-jpg-images-as-textures-using-embedded-c/</guid>
<description><![CDATA[Note texture need to be power of 2. The following libraries need to be linked to you app: Ole32.lib ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Note texture need to be power of 2.</p>
<p><b><u>The following libraries need to be linked to you app:</b></u><br />
Ole32.lib</p>
<p><b></u>The following headers need to be added:</b></u></p>
<pre class="brush: cpp;">
#include &#60;imaging.h&#62;
#include &#60;initguid.h&#62;
#include &#60;imgguids.h&#62;
</pre>
<p>Common variables:</p>
<pre class="brush: cpp;">
IImagingFactory* m_pImgFactory;
IImage* m_pImage;
</pre>
<p>Initialise the library</p>
<pre class="brush: cpp;">
bool InitImageFactory()
{
CoInitializeEx(NULL, COINIT_MULTITHREADED);
return (SUCCEEDED(CoCreateInstance (CLSID_ImagingFactory,NULL,CLSCTX_INPROC_SERVER, IID_IImagingFactory,(void **) &#38; m_pImgFactory)))
}
</pre>
<p>Load the texture</p>
<pre class="brush: cpp;">
bool LoadTexture(wchar_t* full_name)
{
	bool success = false;
	if (full_name!=NULL)
    {
		if(SUCCEEDED(m_pImgFactory-&#62;CreateImageFromFile(full_name, &#38;m_pImage)))
		{
			//get the info
			ImageInfo info = {0};
			m_pImage-&#62;GetImageInfo( &#38;info );
			RECT rc = { 0, 0, info.Width, info.Height };
			int new_width = rc.right;
			int new_height = rc.bottom;

			//create a HBITMAP
			IBitmapImage* pBitmapImage = NULL;
				if (SUCCEEDED(m_pImgFactory-&#62;CreateBitmapFromImage(m_pImage, 0, 0, info.PixelFormat, InterpolationHintNearestNeighbor , &#38;pBitmapImage)))
				{
					//create the texture
					glGenTextures(1, texture);
					glBindTexture(GL_TEXTURE_2D, texture[0]);

					BitmapData bitmapData;
					if ((info.PixelFormat&#38;PixelFormatAlpha)==PixelFormatAlpha)
					{
						pBitmapImage-&#62;LockBits(&#38;rc, ImageLockModeRead, PixelFormat32bppARGB, &#38;bitmapData );
						glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, new_width,new_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, bitmapData.Scan0);
					}
					else
					{
						pBitmapImage-&#62;LockBits(&#38;rc, ImageLockModeRead, PixelFormat16bppRGB565, &#38;bitmapData );
						glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, new_width,new_height, 0, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, bitmapData.Scan0);
					}
					glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);//GL_NEAREST);
					glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);//GL_NEAREST);

					pBitmapImage-&#62;UnlockBits(&#38;bitmapData);
					pBitmapImage-&#62;Release(); 

					success =true;
				}
				m_pImage-&#62;Release();
			}
    }
return success;
}
</pre>
<p>Close the library</p>
<pre class="brush: cpp;">
bool DestroyImageFactory()
{
        m_pImgFactory-&#62;Release();
        CoUninitialize();
}
</pre>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[32bit textures with a 16bit colour display]]></title>
<link>http://greengalaxy.wordpress.com/2009/11/13/32bit-textures-with-a-16bit-colour-display/</link>
<pubDate>Fri, 13 Nov 2009 07:23:39 +0000</pubDate>
<dc:creator>greengalaxy</dc:creator>
<guid>http://greengalaxy.wordpress.com/2009/11/13/32bit-textures-with-a-16bit-colour-display/</guid>
<description><![CDATA[It has been quite a while since I have worked with 16bit displays. All my 3D developement for PC has]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>It has been quite a while since I have worked with 16bit displays.<br />
All my 3D developement for PC has always been done with 32bit colour displays.<br />
This is unfortunately what happens when you try show a 32bit image on a 16 bit display.<br />
Banding!!! Aargh.</p>
<p><b><u>Original (32bit image):</b></u><br />
<img src="http://greengalaxy.wordpress.com/files/2009/11/32bit.jpg" alt="32bit" title="32bit" width="256" height="256" class="alignnone size-full wp-image-160" /></p>
<p><b><u>Nearest colour (32bit image as shown by 16bit colour scheme):</b></u><br />
<img src="http://greengalaxy.wordpress.com/files/2009/11/32bit_on_16bit.jpg" alt="32bit_on_16bit" title="32bit_on_16bit" width="256" height="256" class="alignnone size-full wp-image-161" /></p>
<p>Fortunately this can be fixed with a bit of image processing (convert the image to 32k colours using error diffusion).</p>
<p><b><u>Preprocessed Image shown using nearest colour (32bit image as shown by 16bit colour scheme):</b></u><br />
<img src="http://greengalaxy.wordpress.com/files/2009/11/32bit_on_16bit_error_diffusion.jpg" alt="32bit_on_16bit_error_diffusion" title="32bit_on_16bit_error_diffusion" width="256" height="256" class="alignnone size-full wp-image-163" /></p>
<p>Much better!!</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[ZiiLABS Introduces World's First 1080p Blu-ray Quality Handheld Media Processor]]></title>
<link>http://esbmobile.wordpress.com/2009/11/12/ziilabs-introduces-worlds-first-1080p-blu-ray-quality-handheld-media-processor/</link>
<pubDate>Thu, 12 Nov 2009 15:00:52 +0000</pubDate>
<dc:creator>pH-7</dc:creator>
<guid>http://esbmobile.wordpress.com/2009/11/12/ziilabs-introduces-worlds-first-1080p-blu-ray-quality-handheld-media-processor/</guid>
<description><![CDATA[ZiiLABS, subsidiary of Creative, announced its 3rd generation media-rich application processor ZMS-0]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>ZiiLABS, subsidiary of Creative, announced its 3rd generation media-rich application processor ZMS-08 that brings 1080p Blu-ray quality H.264 playback to low energy devices.</p>
<div id="attachment_112" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-112" title="ZiiLABS ZMS-08 SoC" src="http://esbmobile.wordpress.com/files/2009/11/zms_08.jpg?w=300" alt="ZiiLABS ZMS-08 SoC" width="300" height="141" /><p class="wp-caption-text">ZiiLABS&#39;s ZMS-08 Processor</p></div>
<p>The lower power system-on-chip is packed with impressive array of features:</p>
<ul>
<li>
<ul>
<li>Full HD 1080p high-profile H.264 video decode</li>
<li>Simultaneous H.264 encode and decode at 720p</li>
<li>1080p 24fps encode</li>
<li>Accelerated OpenGL® ES 2.0 3D graphics at up to 1 Gpixels/sec</li>
<li>2D processing, compositing, image processing</li>
<li>Advanced Xtreme Fidelity™ X-Fi Audio effects</li>
<li>Low-power 1GHz ARM Cortex processor</li>
</ul>
</li>
</ul>
<p>The ZMS-08 is aimed at small form factor devices that enable content currently accessed via the PC to spread to mobile and low-energy devices.</p>
<p>Imagine that, Blu-ray quality video, crystal clear video conferencing experience and game console-like 3D and sound effects on future tablets, smartphones and set-top boxes.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[OpenGL EGL Config_android 2.0]]></title>
<link>http://mobilebytes.wordpress.com/2009/11/09/opengl-egl-config_android-2-0/</link>
<pubDate>Mon, 09 Nov 2009 13:02:14 +0000</pubDate>
<dc:creator>sharemefg</dc:creator>
<guid>http://mobilebytes.wordpress.com/2009/11/09/opengl-egl-config_android-2-0/</guid>
<description><![CDATA[In Android 1.1 to Androidd 1.6 EGL configuraitons were being read/sorted worng&nbsp; and thus: ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>In Android 1.1 to Androidd 1.6 EGL configuraitons were being read/sorted worng&#160; and thus:</p>
<p>&#160;</p>
<pre class="brush: java;">
nt[] configSpec = {
        EGL10.EGL_RED_SIZE,      5,
        EGL10.EGL_GREEN_SIZE,    6,
        EGL10.EGL_BLUE_SIZE,     5,
        EGL10.EGL_DEPTH_SIZE,   16,
        EGL10.EGL_NONE
};
</pre>
<p>would work on Android 1.1 through Android 1.6. However, in Andoroid 2.0 you have to use:</p>
<pre class="brush: java;">
nt[] configSpec = {
        EGL10.EGL_RED_SIZE,      5,
        EGL10.EGL_GREEN_SIZE,    6,
        EGL10.EGL_BLUE_SIZE,     5,
        EGL10.EGL_DEPTH_SIZE,   16,
        EGL10.EGL_DONT_CARE
};
</pre>
<p>as the higher config beynd 565 was being sorted read first hence the error.</p>
<div style="margin-top:10px;height:15px;" class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/028735b8-8145-4b42-8d38-e17c642ab3dd/" title="Reblog this post [with Zemanta]"><img style="border:medium none;float:right;" class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_e.png?x-id=028735b8-8145-4b42-8d38-e17c642ab3dd" alt="Reblog this post [with Zemanta]"></a></div>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Anti-Alias = Blend * (1 - Alpha);]]></title>
<link>http://slizerboy.wordpress.com/2009/11/05/anti-alias-blend-1-alpha/</link>
<pubDate>Thu, 05 Nov 2009 19:03:10 +0000</pubDate>
<dc:creator>Robert Chow</dc:creator>
<guid>http://slizerboy.wordpress.com/2009/11/05/anti-alias-blend-1-alpha/</guid>
<description><![CDATA[So the term alpha, in computing, has many meanings. There is alpha testing, where a piece of softwar]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>So the term alpha, in computing, has many meanings.  There is alpha testing, where a piece of software is tested by giving it out to the internal users of an organisation to tear to pieces &#8211; the stage before the public get their betas (I think this is the appropriate time to say that I just got VS2010 beta 2 the other day, and it&#8217;s as sexy as hell, but more on that another time).  It can also be used to describe the weighting of data in machine learning.  But I&#8217;m not doing machine learning.  Or testing (yet).  I&#8217;m doing graphics.</p>
<p>The alpha I am referring to is the alpha channel used to represent a colour, and it&#8217;s very handy.  Although it can be a little misunderstood, as I learnt during my experiments.</p>
<p style="padding-left:30px;"><em><strong>The Alpha Channel</strong></em></p>
<p style="padding-left:60px;">To represent a color, you usually have the option of choosing the red, green and blue components of a color, but what if you want it to be slightly translucent?  There is an alpha component &#8211; this determines how &#8220;full&#8221; the color is.  On a scale of 0 to 1, 0 is transparent, and 1 is opaque; anywhere in between is translucent.  So this is fairly easy to declare in OpenGL.  Where red, green, blue and alpha are float values between 0 and 1:</p>
<p style="padding-left:60px;color:#808000;font-family:Courier;">Gl.glColor4f(red, green, blue, alpha);</p>
<p style="padding-left:60px;">Of course, OpenGL doesn&#8217;t like to make life easy for us, no.  We have to also enable blending.  This allows for the alpha channel to do its magic, and the blend function also determines on how the alpha channel is used.</p>
<p style="padding-left:60px;color:#808000;font-family:Courier;">Gl.glEnable(Gl.GL_BLEND);<br />
Gl.glBlendFunc(Gl.GL_SRC_ALPHA, Gl.GL_ONE_MINUS_SRC_ALPHA);</p>
<p style="padding-left:60px;">The 2 parameters of the blend function determine how the alpha channel is used &#8211; the parameters I have used in the example are the ones best used for transparency.  These parameters allow you to do lots of different blending techniques, such as blend towards no transparency or full transparency, or reverse blend &#8211; I&#8217;m not really the one to ask on how these work, because I&#8217;m not entirely sure &#8211; you&#8217;re best looking it up.  Of course, the complexity doesn&#8217;t stop there either.</p>
<p style="padding-left:30px;"><em><strong>A Trick of Light</strong></em></p>
<p style="padding-left:60px;">When working with transparency, the order of the objects when being drawn is important.  Especially if you are using lighting.</p>
<p style="padding-left:60px;">As a general rule, for opaque objects, draw them in the order of front to back (taking the front as the nearest to you), and for transparent or translucent objects, back to front.</p>
<p style="padding-left:60px;">For opaque objects, this is because (I believe, but not entirely sure)  OpenGL is clever enough to deduce on if an object at the back needs to drawn or not &#8211; it will not be drawn if there is an object in front of it, obscuring the camera view from the object.  Of course, the only way to deduce if there is an object in front of it, is if there is an object already there.</p>
<p style="padding-left:60px;">For transparent and translucent objects, drawing them back to front ensures that the lighting algorithm in OpenGL works properly.  As the object is drawn, it OpenGL will always look at what is behind the object, and try to blend the current object being drawn with what is behind it accordingly.  An object at the front with transparency property will not take into account what is behind it, if the object behind it is being drawn after it.  I found this out when I was trying to draw partially transparent boxes.</p>
<p style="padding-left:60px;text-align:center;"><a rel="attachment wp-att-212" href="http://slizerboy.wordpress.com/2009/11/05/anti-alias-blend-1-alpha/transparencydrawing/"><img class="aligncenter size-full wp-image-212" title="Transparency Drawing" src="http://slizerboy.wordpress.com/files/2009/11/transparencydrawing.png" alt="Transparency Drawing" width="564" height="566" /></a><em>Transparency Drawing.  This shows how drawing partially transparent objects has to be done in a particular way for OpenGL to display the scen properly.  The top two pictures show the component this cube is made out of: an blue opaque base, and a clear, green front.  The picture in the bottom-left shows what happens when the translucent part, at the front, is drawn before the opaque part, behind it.  It looks exactly the same as the picture in the top-right &#8211; this is because it both pictures, the front is blending what was initially behind the it &#8211; the black background.  The bottom-right picture shows the drawing when drawn in the correct order, base first, then the translucent front.</em></p>
<p style="padding-left:30px;"><strong><em>Anti-Aliasing</em></strong></p>
<p style="padding-left:60px;">Anti-aliasing is an effect used to make lines and shapes appear smoother, and less discrete, or pixelated.  This effect does this by a slight blurring, and in effect, is using blending.  As a result, the same rule of drawing transparent objects from back to front should be applied to when trying to use an anti-alias effect.</p>
<p style="padding-left:60px;">There are 3 types of anti-aliasing that OpenGL offers with easy access.  Any other types of anti-aliasing, you will have to look elsewhere &#8211; I am no expert of OpenGL.  Essentially, if you refer back to when I was <a href="http://slizerboy.wordpress.com/2009/10/16/printtruetypefont/">creating fonts</a>, it uses mip-mapping as a way of keeping detail and quality as images are getting smaller and smaller &#8211; you could argue that this is a form of anti-aliasing too.</p>
<p style="padding-left:60px;">The 3 OpenGL offers are line, point and polygon anti-aliasing, and unsurprisingly, they refer to lines, points and polygons.</p>
<p style="padding-left:60px;">These are easy to switch on with an enable call.  You can then provide OpenGL with a parameter on how you want the anti-aliasing effect to behave.</p>
<p style="padding-left:60px;color:#808000;font-family:Courier;">Gl.glEnable(Gl.GL_LINE_SMOOTH);<br />
Gl.glHint(Gl.GL_LINE_SMOOTH_HINT, Gl.GL_FASTEST);</p>
<p style="padding-left:60px;color:#808000;font-family:Courier;">Gl.glEnable(Gl.GL_POINT_SMOOTH);<br />
Gl.glHint(Gl.GL_POINT_SMOOTH_HINT, Gl.GL_NICEST);</p>
<p style="padding-left:60px;color:#808000;font-family:Courier;">Gl.glEnable(Gl.GL_POLYGON_SMOOTH);<br />
Gl.glHint(Gl.GL_POLYGON_SMOOTH_HINT, Gl.GL_DONT_CARE);</p>
<p style="padding-left:60px;">The hints describe how you want OpenGL to do the anti-aliasing &#8211; you can either have it as the nicest OpenGL will allow, the fastest to calculate to save on speed, or nor preference.</p>
<p style="padding-left:60px;text-align:center;"><a rel="attachment wp-att-209" href="http://slizerboy.wordpress.com/2009/11/05/anti-alias-blend-1-alpha/anti-alias/"><img class="aligncenter size-full wp-image-209" title="Anti-Alias Triangles" src="http://slizerboy.wordpress.com/files/2009/11/anti-alias.png" alt="Anti-Alias Triangles" width="343" height="150" /></a><em>Anti-Alias Triangles.  The picture on the left is similar to the picture on the right, with the exception that anti-aliasing is on.  You can notice a subtle difference in the smoothness of the edges on the triangles.  OpenGL achieves this effect using blurring and blending techniques.</em></p>
<p>As a side note, I&#8217;ve now finally started the Renderer component!  So the majority, if not all, of what I have covered so far regarding OpenGL will go into this component.  This will mean that I won&#8217;t be updating big tutorial-esque posts on OpenGL anymore &#8211; there might be something every now and then.  I will however, be posting any revelations I come across!</p>
<p style="padding-left:60px;">
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Add Some Really Slick Screensavers to Ubuntu]]></title>
<link>http://ubuntugenius.wordpress.com/2009/11/05/add-some-really-slick-screensavers-to-ubuntu/</link>
<pubDate>Thu, 05 Nov 2009 13:58:01 +0000</pubDate>
<dc:creator>ubuntugenius</dc:creator>
<guid>http://ubuntugenius.wordpress.com/2009/11/05/add-some-really-slick-screensavers-to-ubuntu/</guid>
<description><![CDATA[If you want a whole bunch of amazing screensavers to add to the default ones that come with Ubuntu, ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><img class="alignleft size-full wp-image-353" title="Just one of the stunning screensavers in the collection" src="http://ubuntugenius.wordpress.com/files/2009/11/euphoria.jpg" alt="Just one of the stunning screensavers in the collection" width="160" height="120" />If you want a whole<strong> bunch of amazing screensavers</strong> to add to the default ones that come with <strong><span style="color:#993300;">Ubuntu</span></strong>, you can do so by installing one package (you will need the <strong><a href="http://ubuntugenius.wordpress.com/2009/11/04/medibuntuget-heaps-more-ubuntu-software-play-encrypted-dvds/">Medibuntu repo</a></strong> for this). <strong><span style="color:#3366ff;">rss-glx</span></strong> is a GLX port of the <strong><a href="http://www.reallyslick.com/" target="_blank">Really Slick Screensavers collection</a></strong>, with several other OpenGL screensavers ported from other platforms included. The screensavers will be integrated into your installed screensaver manager (<strong><span style="color:#800000;">Gnome-Screensaver</span></strong>, <strong><span style="color:#800000;">XScreenSaver</span></strong> or <strong><span style="color:#800000;">KScreenSaver</span></strong>), but can also be run as stand-alone applications.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[howto use Vertex Buffer objects(vbo) with opengl &amp; Qt]]></title>
<link>http://entropologygames.wordpress.com/2009/10/31/howto-use-vertex-buffer-objectsvbo-with-opengl-qt/</link>
<pubDate>Sat, 31 Oct 2009 21:11:37 +0000</pubDate>
<dc:creator>brainydexter</dc:creator>
<guid>http://entropologygames.wordpress.com/2009/10/31/howto-use-vertex-buffer-objectsvbo-with-opengl-qt/</guid>
<description><![CDATA[This how-to concerns, including the functions needed for using Vertex Buffer Objects or VBOs; but in]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>This how-to concerns, including the functions needed for using Vertex Buffer Objects or VBOs; but in Qt framework. In short, this answers questions like:</p>
<p>“ glGenbuffers : identifier not found error</p>
<p>How do I resolve this (when working in Qt)? “</p>
<p>&#160;</p>
<p>This <a href="http://www.gamedev.net/reference/programming/features/oglext/default.asp" target="_blank">article at gamedev</a> explains the process very well. The article is old, but I would recommend reading it since you then understand what the problem is and why is it giving you this error.</p>
<p>After you’re done reading that, you’d know that you are still using openGL v1.1 and need to access VBOs which is a feature of openGL v1.5. This is done by using v1.5 as extensions and interacting with the device drivers(assuming you have the latest drivers and they support v1.5), which is facilitated in code by specific function pointers. </p>
<p>&#160;</p>
<p>By now, you’d know how to get this fixed if you were on a windows machine. But, I was using Qt and needed a way to get it to work with that. I came across these files:</p>
<p>glextensions.h and </p>
<p>glextensions.cpp</p>
<p>provided by Qt in one of there demos (<strong>boxes</strong>). These would resolve the functions you need for using VBOs. To get it to work, the code is not trivial.</p>
<p>After including the files in your header, one needs to “resolve()” the associated functions with a “context” (which is provided by the QGLWidget (or a class that you might have derived from it) ).</p>
<p>This is how I resolve them from within my class which derives from QGLWidget: </p>
<p>getGLExtensionFunctions().resolve(this-&#62;context() );</p>
<p>&#160;</p>
<p>Functions like glGenBuffers, glBindBuffer, glBufferData etc are now ready to be used.</p>
<p>&#160;</p>
<p>Also, I heard a lot of people using GLEW but I did not explore that route, so if you are stuck that might be something worthwile to checkout.</p>
<p>I hope it this article has saved you both, hours and tears. Let me know if you need any help.</p>
<p>(PS: When you call the resolve() function, the context should be available. I am still not 100% clear on how Qt manages the context for you, but I call it within InitializeGL(), since the context would be ready when the control reaches there. Also, take a look at the glextensions files to see they do pretty much the same thing as mentioned in the <a href="http://www.gamedev.net/reference/programming/features/oglext/default.asp" target="_blank">gamedev article</a> )</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[NOte: Install OpenGL on Ubuntu 9.04]]></title>
<link>http://sirivy.wordpress.com/2009/10/31/note-install-opengl-on-ubuntu-9-04/</link>
<pubDate>Sat, 31 Oct 2009 09:32:12 +0000</pubDate>
<dc:creator>sirivy</dc:creator>
<guid>http://sirivy.wordpress.com/2009/10/31/note-install-opengl-on-ubuntu-9-04/</guid>
<description><![CDATA[Just note for OpenGL installation on Ubuntu 9.04 You can use Synaptic Package Manager to install pac]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Just note for OpenGL installation on Ubuntu 9.04</p>
<p>You can use Synaptic Package Manager to install package name glutg3-dev .  The list of dependency packages , which are automatically installed, are the following packages:  freeglut3-dev libgl1-mesa-dev libglu1-mesa-dev libxt-dev mesa-common-dev xlibmesa-gldev.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[OpenGL Debugging]]></title>
<link>http://mobilebytes.wordpress.com/2009/10/30/opengl-debugging/</link>
<pubDate>Sat, 31 Oct 2009 05:54:57 +0000</pubDate>
<dc:creator>sharemefg</dc:creator>
<guid>http://mobilebytes.wordpress.com/2009/10/30/opengl-debugging/</guid>
<description><![CDATA[Often you have to trun off Log.* statements, Debug.* statements, etc so I sue a simple System.out.pr]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Often you have to trun off Log.* statements, Debug.* statements, etc so I sue a simple System.out.print set-up:</p>
<pre class="brush: java;">
public class SystemOutPrint {

	/**
	 *
	 * @param str
	 */
	public SystemOutPrint(String str){
		System.out.print(str);

	}

	/**
	 *
	 * @param obj
	 */
	public SystemOutPrint(Object obj) {
		System.out.print(obj);
	}

	/**
	 *
	 * @param obj
	 * @param str
	 */
	public SystemOutPrint(Object obj, String str) {
		System.out.print(obj);
		System.out.print(str);
	}
</pre>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[AndThenThereWas(light);]]></title>
<link>http://slizerboy.wordpress.com/2009/10/30/andthentherewaslight/</link>
<pubDate>Fri, 30 Oct 2009 14:54:00 +0000</pubDate>
<dc:creator>Robert Chow</dc:creator>
<guid>http://slizerboy.wordpress.com/2009/10/30/andthentherewaslight/</guid>
<description><![CDATA[Lighting and Materials. Theoretically, it&#8217;s one of the first things you should really learn wh]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Lighting and Materials. Theoretically, it&#8217;s one of the first things you should really learn when you&#8217;re getting into graphics &#8211; it&#8217;s usually within the first 10 tutorials that you&#8217;ll pick up from anywhere. In theory, no one should have much of a problem with it. In theory, theorists should have done their research before making these theories. But then again, I am no theorist.</p>
<p>This carries on from my <a href="http://slizerboy.wordpress.com/2009/10/23/route-scenic/">last post</a>.  So we&#8217;re going to touch up on how I made the planets glow like they do in the picture, and how lighting and materials have been an absolute pain (that is, until I finally decided to do a little reading).</p>
<p style="padding-left:30px;"><strong><em>Dim Lighting</em></strong></p>
<p style="padding-left:60px;">The first time I touched lighting and materials was in university during an examples class &#8211; and it was easy.  All I had to do as change a couple of numbers, and voila, the lighting changed.  It&#8217;s a little bit more difficult when I was trying it out for myself.  The first thing I tried to demo was a rotating diamond, with a static light shining on it.  As the diamond rotated, the light was moving up and down.  How, and why, I have no idea, and I still don&#8217;t.  Second thing I tried was to have the light in the middle of the scene, and 2 gluSpheres either side, so each would have only the side facing the light shining, and the other dark as night.  Nope.  As I drew the second sphere, it would look exactly the same as the first &#8211; light shining on the same side.  And no idea still as to why.  Maybe I&#8217;m missing something really important, that not many people have encountered before (by the way, quite a few people have had the problem with the light moving up and down as the object rotates), or maybe I&#8217;m just unlucky.</p>
<p style="padding-left:60px;">It could be seen as a bad thing that I still don&#8217;t know why the lights weren&#8217;t working the way I wanted them to &#8211; I&#8217;ve managed to get over it.  Because now I know how lights work, and I don&#8217;t really see why I would want to replicate the problems again.</p>
<p style="padding-left:30px;"><em><strong>Lighting</strong></em><strong><em> &#38; Materials</em></strong></p>
<p style="padding-left:60px;">The calls to create lighting and materials are very short and simple.  Initially, you need to enable lighting, and also, enable the lights &#8211; OpenGL allows you to use 8 lights in total, and say that you should really reconsider your model if you need any more.   So apart from the enable call, there are only 3 calls that you really need to consider. The first describes the general light model, and the other two each describe either the lighting or the materials.  These are, respectively:</p>
<p style="padding-left:60px;color:#808000;font-family:Courier;">Gl.glLightModelfv(<span style="color:#888888;"><em>pName</em></span>, <span style="color:#888888;"><em>params</em></span>);</p>
<p style="padding-left:60px;"><span style="color:#808000;font-family:Courier;">Gl.glLightfv(<span style="color:#888888;"><em>light</em></span>, <em><span style="color:#888888;">pname</span></em>, <em><span style="color:#888888;">param</span></em>);</span><br />
where light is the light number, from <span style="color:#808000;font-family:Courier;">Gl.GL_LIGHT0</span> to <span style="color:#808000;font-family:Courier;">Gl.GL_LIGHT7</span>.<br />
and pName is either <span style="color:#808000;font-family:Courier;">Gl.GL_POSITION</span>, <span style="color:#808000;font-family:Courier;">Gl.GL_AMBIENT</span>, <span style="color:#808000;font-family:Courier;">Gl.GL_DIFFUSE</span> or <span style="color:#808000;font-family:Courier;">Gl.GL_SPECULAR</span>.*</p>
<p style="padding-left:60px;"><span style="color:#808000;font-family:Courier;">Gl.glMaterialfv(<em><span style="color:#888888;">face</span></em>, <span style="color:#888888;"><em>pname</em></span>, <em><span style="color:#888888;">param</span></em>);</span><br />
where the face is either <span style="color:#808000;font-family:Courier;">Gl.GL_FRONT</span>, or <span style="color:#808000;font-family:Courier;">Gl.GL_BACK</span>.<br />
and pName is either <span style="color:#808000;font-family:Courier;">Gl.GL_AMBIENT</span>, <span style="color:#808000;font-family:Courier;">Gl.GL_DIFFUSE</span>, <span style="color:#808000;font-family:Courier;">Gl.GL_SPECULAR</span>, <span style="color:#808000;font-family:Courier;">Gl.GL_SHININESS</span> or <span style="color:#808000;font-family:Courier;">Gl.GL_EMISSION</span>.*</p>
<p style="padding-left:60px;">(bearing in mind that the suffix fv applies to float arrays only &#8211; this needs to be changed if you were to use any other, say double &#8211; this would be dv).</p>
<p style="padding-left:60px;">*For now, I will only be looking at the specific parameters I have enlisted.  For further information, you can find it in the <a href="http://www.opengl.org/sdk/docs/man/xhtml/">OpenGL Documentation</a>.</p>
<p style="padding-left:30px;"><em><strong>Placing A Light</strong></em></p>
<p style="padding-left:60px;">Where you place a light in the scene is very important &#8211; this is where the light source is, and will be used to calculate how light bounces and reflects off materials.  In order for you to be able to place your light in a desired position, you need to understand how it is set up.  To set up a light, you use the glLight() call, with parameter GL_POSITION.  Obvious right?  The params should be a vector, indicating x, y, z and w.  x, y and z are your co-ordinates of the light, and I&#8217;ve a feeling that w should <em>always be 1.0f</em> in order for it to work this way.  However, despite making this call, the light is not necessarily in the place you have specified in world space.  The call will always look at what is the current modelview matrix at the time of the call, and will always place the light specific to the matrix.  Therefore if the entire scene is to be translated backwards so it will fit into a frustum view volume, make a call to set the light position <em>after</em> the translation.</p>
<p style="padding-left:30px;"><strong><em>Lighting and Material Properties</em></strong></p>
<p style="padding-left:60px;">The properties I have outlined, you will see everywhere in material and lighting.  The properties describe how the light reacts to surfaces.</p>
<p style="padding-left:60px;"><em><strong>Ambient</strong></em><br />
Describes the general lighting of an object &#8211; it has brilliantly been quoted from my 2nd year course as, &#8220;it just hangs there&#8221;.  As a result, it does not take into account how light reflects off a particular object &#8211; it is the general lighting &#8211; and as a result, it will not help to define the contours of any shape.</p>
<p style="padding-left:60px;"><em><strong>Diffuse<br />
</strong></em>This property describes the diffuse reflection of a material.  This takes into account of how the light will reflect off a particular surface, and how some of the light will also be absorbed.  Using the ambient property will describe the general color of an object, whereas to define how the object looks in light, use the diffuse property.</p>
<p style="padding-left:60px;"><em><strong>Specular<br />
</strong></em>Lighting will sometimes reflect entirely off an object &#8211; this depends on the angle the light is reflecting off the surface at.  Specular reflection reflects the light shining onto an object and makes it appear shiny; the scale is determined by the shininess property.</p>
<p style="padding-left:60px;"><strong><em>Shininess</em></strong><br />
The describes the sharpness of the light reflected due to specular lighting.  The higher the value, the more shiny it is, and therefore the sharper the image of the light reflecting off the object.</p>
<p style="padding-left:60px;"><em><strong>Emission<br />
</strong></em>This property describes the amount of light that is emitted off an object.  In OpenGL, the property makes the object appear as if it is emitting light, however, in the model, this light does not affect any other objects &#8211; you will need to use an actual light for this.</p>
<p style="padding-left:60px;">Setting the material properties will affect how light reacts to an object &#8211; the light properties also need to be set for this to happen.  All of the above properties take a float array, representing red, green, blue and alpha, with the exception of shininess, which takes a number between 0 and 128.</p>
<p style="padding-left:60px;text-align:center;"><a rel="attachment wp-att-194" href="http://slizerboy.wordpress.com/2009/10/30/andthentherewaslight/lightproperties/"><img class="aligncenter size-full wp-image-194" title="Light Properties" src="http://slizerboy.wordpress.com/files/2009/10/lightproperties.png" alt="Light Properties" width="655" height="166" /></a><span style="color:#000000;"><em>Light Properties.  This depicts how, from left to right, ambient, diffuse and specular lighting can be used together to represent a 3-D sphere, far right.</em></span></p>
<p style="padding-left:60px;">
<p style="padding-left:30px;"><strong><em>Solar System</em></strong></p>
<p style="padding-left:60px;">So now you know how it is done, it&#8217;s time to put it all together.  In my solar system model, I used two lights: one to represent the sun; and the other, to add a little extra.<strong><em> </em></strong></p>
<p style="padding-left:60px;">To set up, we describe the light model, and then the lights we&#8217;re going to use &#8211; do this at the start so it doesn&#8217;t get called millions of times in the render loop. As we are simulating outer space, the light model is set at very low, near black.  The ambient and diffuse settings for the lights are also set up.</p>
<p style="padding-left:60px;color:#808000;font-family:Courier;">Gl.glLightModelfv(Gl.GL_LIGHT_MODEL_AMBIENT, new float[] { 0.05f, 0.05f, 0.05f, 1.0f });</p>
<p style="padding-left:60px;color:#808000;font-family:Courier;">Gl.glLightfv(Gl.GL_LIGHT0, Gl.GL_AMBIENT, new float[] { 0.0f, 0.0f, 0.0f, 1.0f });<br />
Gl.glLightfv(Gl.GL_LIGHT0, Gl.GL_DIFFUSE, new float[] { 1.0f, 1.0f, 1.0f, 1.0f });<br />
Gl.glLightfv(Gl.GL_LIGHT1, Gl.GL_AMBIENT, new float[] { 0.0f, 0.0f, 0.0f, 1.0f });<br />
Gl.glLightfv(Gl.GL_LIGHT1, Gl.GL_DIFFUSE, new float[] { 1.0f, 1.0f, 1.0f, 1.0f });</p>
<p style="padding-left:60px;color:#808000;font-family:Courier;">Gl.glEnable(Gl.GL_LIGHTING);<br />
Gl.glEnable(Gl.GL_LIGHT0);</p>
<p style="padding-left:60px;">You will have noticed that I have also enabled lighting, and Light0, but not Light1.  Using light0 as my main light to represent the sun, this will be constantly on, and therefore we do not need to call this in the render loop, as it only needs to be called once.  I am using Light1 as an effect on the sun, to make it appear 3-D, and therefore should only be turned on when I render the sun, but turned off when I render everything else.  The reason behind using the light as an effect on the sun is because I am setting the sun to have an emission property.  The makes the sun appear as if it is giving out light.  Not only this, but the light source representing the sun is inside the sun sphere, and will not affect the outside, making the sphere look flat.  Turning a light onto the sun, and using a diffuse property, will make the sun appear 3-D.  Now to render the scene.</p>
<p style="padding-left:60px;">First we translate the scene into view, it is here, where we place the light representing the sun.  Note that I am placing the light position after the translation so the light is also in view.  The light is not, however, affected by the rotation after the position call, nor any other call after regarding the matrix stacks.</p>
<p style="padding-left:60px;color:#808000;font-family:Courier;">Gl.glMatrixMode(Gl.GL_MODELVIEW);<br />
Gl.glLoadIdentity();</p>
<p style="padding-left:60px;color:#808000;font-family:Courier;">Gl.glTranslatef(-2000.0f, 0.0f, -4000.0f);<br />
Gl.glLightfv(Gl.GL_LIGHT0, Gl.GL_POSITION, new float[] { 0f, 0f, 0f, 1.0f });<br />
Gl.glRotatef(30, 1, 0, 0);</p>
<p style="padding-left:60px;">We want to draw the sun, with a radius of about 140.0f, and to have a light shining onto it so it appears 3-D.  This is where Light1 comes in.  It is placed just outside of the sun so it is able to hint the sphere with a bit of light.</p>
<p style="padding-left:60px;color:#808000;font-family:Courier;">Gl.glLightfv(Gl.GL_LIGHT1, Gl.GL_POSITION, new float[] { 150.0f, 150.0f, 150.0f, 1.0f });<br />
Gl.glEnable(Gl.GL_LIGHT1);<br />
Gl.glMaterialfv(Gl.GL_FRONT, Gl.GL_AMBIENT_AND_DIFFUSE, new float[] {1.0f, 1.0f, 0.5f, 1.0f });<br />
Gl.glMaterialfv(Gl.GL_FRONT, Gl.GL_EMISSION, new float[] { 1.0f, 1.0f, 0.5f, 1.0f });<br />
<span style="color:#888888;">// Draw GluSphere here</span><br />
Gl.glDisable(Gl.GL_LIGHT1);</p>
<p style="padding-left:60px;">I have used a little shortcut here, declaring the ambient and diffuse property at the same time.  This is very useful, as the cahnces are, these will be the same values for the majority of basic objects anyway.  Enabling the light before and after drawing the sun makes sure that the light only affects the sun and no other object that is being rendered.  Now we are free to draw the other planets.  Using a similar approach, we set the position, and material, and draw.  We only need to set the material once if the following objects use the same material.  Similar to glColor() &#8211; you only set the color if the next vertex to be drawn is a different color to that of the current one being drawn.  Therefore when we draw the other planets, we have to make sure we set the emission to black, otherwise it will appear all the planets are giving off light!</p>
<p>Do bear in mind that in order for your lighting and materials to work properly, enable lighting.  The material settings will automatically override the color settings you have, so if you want to draw an object without the material lighting, just remember to disable it first!</p>
<p>I know this post has been very long, slightly overdue, and may seem like it&#8217;s been cut short, and to be fair, it could be a lot longer and more well covered.  I&#8217;ll try to keep the next one shorter, I promise!</p>
<p style="padding-left:60px;">
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[OpenGL stereoscopic anaglyphs and patents]]></title>
<link>http://codelab.wordpress.com/2009/10/30/opengl-stereoscopic-anaglyphs/</link>
<pubDate>Fri, 30 Oct 2009 01:27:51 +0000</pubDate>
<dc:creator>Nuclear</dc:creator>
<guid>http://codelab.wordpress.com/2009/10/30/opengl-stereoscopic-anaglyphs/</guid>
<description><![CDATA[An anaglyph is a combination of two images into one, in such a way that they can later be separated ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>An anaglyph is a combination of two images into one, in such a way that they can later be separated by viewing the image through appropriately colored transparent filters. The objective is to present slightly shifted views of the same 3D environment to each eye, in order to achieve depth perception (i.e. really perceive the 3rd dimension).</p>
<p><img src="http://codelab.wordpress.com/files/2009/10/ccglasses-thumb.jpg" alt="anaglyph glasses" title="ColorCode3D anaglyph glasses" width="256" height="160" class="alignright size-full wp-image-96" /></p>
<p>I&#8217;ve never dealt with anaglyphs in the past, but during my recent week-old obsession with stereoscopy, I&#8217;ve stumbled upon a pair of free anaglyph viewing glasses (made out of cardboard and cellophane of course). So I couldn&#8217;t help but try to find out how I can use them with my own programs.<br />
<!--more--></p>
<p>I dug up a small dungeon editor I&#8217;ve written some time ago, and hacked stereoscopic rendering into it. I implemented various stereo rendering modes including cross-eyed (side-by side images), quad-buffered (the native OpenGL stereo mode), and anaglyphs.</p>
<p>Quad-buffering is of course the ideal method to present stereo views in OpenGL, but it requires support from the graphics driver and expensive hardware such as <a href="http://en.wikipedia.org/wiki/Shutter_glasses">shutter glasses</a> or a pair of polarized projectors and <a href="http://en.wikipedia.org/wiki/Polarized_glasses">polarized glasses</a>.</p>
<p>The problem with the glasses that I&#8217;ve got is that all articles regarding anaglyphs I&#8217;ve found on the internet talked about either red/blue or red/cyan glasses, while mine was obviously neither. It turns out my glasses are for a new variety of anaglyphs which go by the name <em>ColorCode3D</em> and are supposed to be able to keep more color information than previous red/blue and red/cyan methods (which generally only work for grayscale images).</p>
<p>This color-code thing is apparently patented and there&#8217;s no mention anywhere on how to combine stereo images for viewing with color-code glasses. The company who owns the patent has released a program for converting stereo pairs of images to colorcode anaglyphs, which is of course proprietary and doesn&#8217;t come with source code, ergo useless.</p>
<p>Then I remembered that there&#8217;s an upside to a patented algorithm if you choose to completely disregard patent law, which I definitely do. In order for an algorithm to become patented, it must be described in detail in a patent application which must be filed at the patent office. All such patent documents are publicly available at the web site of the US patent office. So I just got the patent document, and implemented the algorithm from that description.</p>
<p>It turns out the process is extremely simple, although just outside the reach of the OpenGL fixed function pipeline, which can be used to handle red/blue and red/cyan anaglyphs easily by employing additive blending and color masks. To combine the left/right stereo pair into a single color-code compatible image:</p>
<ul>
<li>The red channel of the left image is used as the red channel of the output image.</li>
<li>The green channel of the left image is used as the green channel of the output image.</li>
<li>All three color channels of the right image are converted to grayscale as follows: <img src='http://l.wordpress.com/latex.php?latex=%5Cleft%28r%5C+g%5C+b%5Cright%29+%5Ccdot+%5Cleft%280.15%5C+0.15%5C+0.7%5Cright%29&#038;bg=ffffff&#038;fg=000000&#038;s=0' alt='\left(r\ g\ b\right) \cdot \left(0.15\ 0.15\ 0.7\right)' title='\left(r\ g\ b\right) \cdot \left(0.15\ 0.15\ 0.7\right)' class='latex' />, and are used as the blue channel of the output image.</li>
</ul>
<p>Here&#8217;s the small GLSL program I used to combine the two left and right images, previously rendered into two textures:<br />
<code>
<pre>uniform sampler2D tex_left, tex_right;

void main()
{
	vec3 left = texture2D(tex_left, gl_TexCoord[0].st).rgb;
	vec3 right = texture2D(tex_right, gl_TexCoord[0].st).rgb;

	vec3 col, coeff = vec3(0.15, 0.15, 0.7);
	col.r = left.r;
	col.g = left.g;
	col.b = dot(right, coeff);

	gl_FragColor = vec4(col, 1.0);
}</pre>
<p></code></p>
<p>The result is fantastic, I&#8217;m using the space navigator to navigate in the 3D dungeon without taking my eyes off the screen, and the stereoscopic effect is very evident indeed, creating the illusion of depth quite effectively.</p>
<p>Here are a few of screenshots in both color-code and the more common red/cyan anaglyph variety (note that I don&#8217;t have red/cyan glasses, so I can only assume that the red/cyan rendering works correctly, I haven&#8217;t tested it).</p>
<p>The second one with the jutting pillar is particularly nice. The geometry crosses the zero-parallax plane into the negative subspace, making the pillar seem to &#8220;come out of the screen&#8221;.</p>
<p><a href="http://codelab.wordpress.com/files/2009/10/stereo1.jpg"><img src="http://codelab.wordpress.com/files/2009/10/stereo1.jpg?w=150" alt="colorcode (amber/blue) anaglyph 1" title="colorcode (amber/blue) anaglyph 1" width="150" height="112" class="alignnone size-thumbnail wp-image-101" /></a><a href="http://codelab.wordpress.com/files/2009/10/stereo2.jpg"><img src="http://codelab.wordpress.com/files/2009/10/stereo2.jpg?w=150" alt="colorcode (amber/blue) anaglyph 2" title="colorcode (amber/blue) anaglyph 2" width="150" height="112" class="alignnone size-thumbnail wp-image-101" /></a></p>
<p><a href="http://codelab.wordpress.com/files/2009/10/stereo_redcyan1.jpg"><img src="http://codelab.wordpress.com/files/2009/10/stereo_redcyan1.jpg?w=150" alt="red/cyan anaglyph 1" title="red/cyan anaglyph 1" width="150" height="112" class="alignnone size-thumbnail wp-image-108" /></a><a href="http://codelab.wordpress.com/files/2009/10/stereo_redcyan2.jpg"><img src="http://codelab.wordpress.com/files/2009/10/stereo_redcyan2.jpg?w=150" alt="red/cyan anaglyph 2" title="red/cyan anaglyph 2" width="150" height="112" class="alignnone size-thumbnail wp-image-109" /></a></p>
<p><b>References</b></p>
<ol>
<li><a href="http://local.wasp.uwa.edu.au/~pbourke/miscellaneous/stereographics/stereorender">Paul Bourke, Calculating Stereo Pairs</a></li>
<li><a href="http://local.wasp.uwa.edu.au/~pbourke/texture_colour/anaglyph">Paul Bourke, Creating Anaglyphs using OpenGL</a></li>
<li><a href="http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO2&#38;Sect2=HITOFF&#38;p=1&#38;u=%2Fnetahtml%2FPTO%2Fsearch-bool.html&#38;r=1&#38;f=G&#38;l=50&#38;co1=AND&#38;d=PTXT&#38;s1=6,687,003.PN.&#38;OS=PN/6,687,003&#38;RS=PN/6,687,003">US Patent #6,687,003: Method for recording and viewing stereoscopic images in color using multichrome filters</a></li>
</ol>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[GLGraphics 0.9.2: better integration with Processing camera (and more)]]></title>
<link>http://codeanticode.wordpress.com/2009/10/26/glgraphics_092/</link>
<pubDate>Mon, 26 Oct 2009 23:28:37 +0000</pubDate>
<dc:creator>ac</dc:creator>
<guid>http://codeanticode.wordpress.com/2009/10/26/glgraphics_092/</guid>
<description><![CDATA[This new release of GLGraphics (0.9.2, Update: use this other package if you need a Java5-compatible]]></description>
<content:encoded><![CDATA[This new release of GLGraphics (0.9.2, Update: use this other package if you need a Java5-compatible]]></content:encoded>
</item>
<item>
<title><![CDATA[Belajar OpenGL with Delphi]]></title>
<link>http://yuda90.wordpress.com/2009/10/26/belajar-opengl-with-delphi/</link>
<pubDate>Mon, 26 Oct 2009 13:34:38 +0000</pubDate>
<dc:creator>yuda90</dc:creator>
<guid>http://yuda90.wordpress.com/2009/10/26/belajar-opengl-with-delphi/</guid>
<description><![CDATA[Pada binggung ya apa sih tu openGL? saya juga binggung kok pada awalnya tapi setelah saya tanya ma m]]></description>
<content:encoded><![CDATA[Pada binggung ya apa sih tu openGL? saya juga binggung kok pada awalnya tapi setelah saya tanya ma m]]></content:encoded>
</item>

</channel>
</rss>
