Showing posts with label pyopengl. Show all posts
Showing posts with label pyopengl. Show all posts

2011-07-11

Installing PyOpenGL-3.0.1 in Ubuntu 10.04 LTS

Why couldn't I find this in the first 6 hours of searching???

http://docs.python.org/release/3.0.1/download.html

And right there at the "Cheese Shop" too... aye aye yae! The instructions for installing were on page 8 of the 50 page document.

(*note: if you are seeing this for the first time be sure and install the necessary dependencies [see below], AND remove any former installations of PyOpenGL, such as PyOpenGL-3.0.0 before continuing)

All I had to do was download the tarball from http://www.python.org/ftp/python/3.0.1/Python-3.0.1.tar.bz2

Move it to /usr/local/src

Right click on it and choose "extract here".

Open a terminal and type:

cd /usr/local/src/PyOpenGL-3.0.1

Then:

sudo python setup.py install

Entered my password and watched it go.

Just like that I was back in business and running the afore mentioned demo on my other machine.

I should throw in a caveat here. I did in fact first install Numpy, PIL, and GLUT as dependencies already, for when I was running PyOpenGL-3.0.0. These all have executable "instant" installers available so long as you are running python 2.6. Find them here.

To remove former installation PyOpenGL-3.0.0 I just opened Synaptic Package Manager (System/Administration/Synaptic Package Manager) searched for "pyopengl", right clicked on "...3.0.0" when it showed up, and selected "Remove Completely".
=============================================

An Ubuntu link that also may be helpful on troublesome tarball installs:
https://help.ubuntu.com/community/CompilingEasyHowTo

2011-07-10

A Simple PyOpenGL-3.0.1 Shader Demo

Alright. Here is that code that I mentioned in an earlier post. Know that you will need to install Python 2.6 and PyOpenGL-3.0.1 in order to run this code. It takes advantage of the new shader convenience module found in 3.0.1. This helped make switching shaders on the fly much easier to implement. Type "," or "." to page through shaders. "n" to toggle normals from "averaged" to "flat". When viewing "no shader" hit "1" or "2" to toggle light0 and light1 on/off respectively. Oh, and can't forget, "r" to start the spheres rotating. The sphere on the left is a glutSolidSphere, the one on the right is a sphere built from a .msh file that Mike wrote.

Look through the code! I hope it's helpful to someone, somewhere.

rendersphere.py
sphere1218.msh

PS. I may update this later and include more information on the dependencies and/or installing the correct versions of PyOpenGL... etc.

PyOpenGL-3.0.1 is only available as a tarball and/or .bz2 package. So... check
out my later post http://ultraopengl.blogspot.com/2011/07/installing-pyopengl-301.html for info on installing it.