473,804 Members | 2,273 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

python and glut

hi there.

i installed python2.3-opengl, then i tried one of those demos:

----

#!/usr/bin/python2.3

# This is statement is required by the build system to query build info
if __name__ == '__build__':
raise Exception

import sys
from OpenGL.GL import *
from OpenGL.GLE import *
from OpenGL.GLUT import *
class GLE_demo:

def __init__(self):
# initial mouse position
self.lastx = 121
self.lasty = 121

# set the display mode and create the window
glutInitDisplay Mode(GLUT_DOUBL E | GLUT_RGB | GLUT_DEPTH)
glutCreateWindo w("GLE demo")

# setup the callbacks
glutDisplayFunc (self.on_displa y)
glutMotionFunc( self.on_motion)
glutReshapeFunc (self.on_reshap e)

#
glClearDepth(1. 0)
glEnable(GL_DEP TH_TEST)
glClearColor(0. 0, 0.0, 0.0, 0.0)
glShadeModel(GL _SMOOTH)

glMatrixMode(GL _MODELVIEW)
# initialize lighting */
glLightfv(GL_LI GHT0, GL_POSITION, (40.0, 40, 100.0, 0.0))
glLightfv(GL_LI GHT0, GL_DIFFUSE, (0.99, 0.99, 0.99, 1.0))
glEnable(GL_LIG HT0)
glLightfv(GL_LI GHT1, GL_POSITION, (-40.0, 40, 100.0, 0.0))
glLightfv(GL_LI GHT1, GL_DIFFUSE, (0.99, 0.99, 0.99, 1.0))
glEnable(GL_LIG HT1)
glEnable(GL_LIG HTING)
glColorMaterial (GL_FRONT_AND_B ACK, GL_DIFFUSE)
glEnable(GL_COL OR_MATERIAL)
def on_motion(self, x, y):
# store the mouse coordinate
self.lastx = x
self.lasty = y
# redisplay
glutPostRedispl ay()
def on_reshape(self , width, height):
# setup the viewport
glViewport(0, 0, width, height)
# setup the projection matrix
glMatrixMode(GL _PROJECTION)
glLoadIdentity( )
# calculate left/right and top/bottom clipping planes
based the
smallest square viewport
a = 9.0/min(width, height)
clipping_planes = (a*width, a*height)
# setup the projection
glFrustum(-clipping_planes[0], clipping_planes[0],
-clipping_pla
nes[1], clipping_planes[1], 50.0, 150.0)
def on_display(self ):
# clear the buffer
glClear(GL_COLO R_BUFFER_BIT | GL_DEPTH_BUFFER _BIT)

# Set up the model view matrix
glMatrixMode(GL _MODELVIEW)
glLoadIdentity( )
glTranslatef(0. 0, 0.0, -80.0)
glRotatef(self. lastx, 0.0, 1.0, 0.0)
glRotatef(self. lasty, 1.0, 0.0, 0.0)

# a nice pale lime green
glColor3f(0.6, 0.8, 0.3)

# set the join styles for GLE
gleSetJoinStyle (TUBE_NORM_EDGE | TUBE_JN_ANGLE |
TUBE_JN_CAP)
gleHelicoid(1.0 , 6.0, 2.0, -3.0, 4.0, None, None, 0.0,
1080.0)

# swap the buffer
glutSwapBuffers ()

if __name__ == '__main__':
# initialize GLUT
glutInit(sys.ar gv)
# create the demo window
GLE_demo()
# enter the event loop
glutMainLoop ()

----

(sorry for some line breaks, some day i'll repair my newsreader)

but when i try to run it:

$ python GLE.py
freeglut (GLE.py): OpenGL GLX extension not supported by display ':0.0'

what's up? what's missing?

i use a standard debian installation.

thanks for your attention

bye

max
Jul 19 '05 #1
9 4765
"max(01)*" <ma**@fisso.cas a> writes:
$ python GLE.py
freeglut (GLE.py): OpenGL GLX extension not supported by display ':0.0'

what's up? what's missing?
The GLX extension to your X server.
i use a standard debian installation.


I don't know which X debian uses, and it may have changed over time,
so you'll want to specify the name of the distribution. You'd be
better off asking in a support group for the X distribution you're
using.

<mike
--
Mike Meyer <mw*@mired.or g> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
Jul 19 '05 #2
See if you can run `glxgears`, and read the output of `glxinfo`. If
neither of those work, you will probably have better luck on a debian
or XFree86/xorg forum than on c.l.py

Jul 19 '05 #3
Mike Meyer wrote:
"max(01)*" <ma**@fisso.cas a> writes:

$ python GLE.py
freeglut (GLE.py): OpenGL GLX extension not supported by display ':0.0'

what's up? what's missing?

The GLX extension to your X server.

i use a standard debian installation.

I don't know which X debian uses, and it may have changed over time,


mine uses XFree86, Version 4.3.0.1 (from the man page)
so you'll want to specify the name of the distribution.


woody.

thanks

max
Jul 19 '05 #4
Lonnie Princehouse wrote:
See if you can run `glxgears`, and read the output of `glxinfo`.


$ glxgears
Xlib: extension "GLX" missing on display ":0.0".
Error: couldn't get an RGB, Double-buffered visual
$ glxinfo
name of display: :0.0
Xlib: extension "GLX" missing on display ":0.0".
Xlib: extension "GLX" missing on display ":0.0".
Xlib: extension "GLX" missing on display ":0.0".
Error: couldn't find RGB GLX visual

visual x bf lv rg d st colorbuffer ax dp st accumbuffer ms cav
id dep cl sp sz l ci b ro r g b a bf th cl r g b a ns b eat
----------------------------------------------------------------------
Xlib: extension "GLX" missing on display ":0.0".
Xlib: extension "GLX" missing on display ":0.0".
0x21 16 tc 1 0 0 c . . 0 0 0 0 0 0 0 0 0 0 0 0 0 None

----

now what?

bye

max
Jul 19 '05 #5
Lonnie Princehouse wrote:
See if you can run `glxgears`, and read the output of `glxinfo`. If
neither of those work, you will probably have better luck on a debian
or XFree86/xorg forum than on c.l.py


your hints were helpful anyway. thanks!

ok, i uncommented the line:

Load "glx"

in my /etc/X11/XF86Config file.

now glxgears seems to work...

except for the following message:

Xlib: extension "XFree86-DRI" missing on display ":0.0".

can you give some more help? (sorry again for being offtopic)

max
Jul 19 '05 #6
Welcome to the exciting world of trying to make graphics work on Linux
=)

DRI is direct rendering. The Module section of your XF8Config should
have:

Load "glx"
Load "dri"
Load "GLCore"

That probably won't solve things.
Google for some combination of ("debian" + "xfree86" + your video
card), and also Google the error messages you get (e.g. "XFree86-DRI
missing on display" )

DRI not working could also be a permissions issue; check to see if it
works as root.

Once your XFree86 is set up properly, the Python OpenGL bindings should
work just fine.

Jul 19 '05 #7
Lonnie Princehouse wrote:
DRI not working could also be a permissions issue; check to see if it
works as root.


that's it! :-)

now, how can i make it work as "joe user"?

bye

max
Jul 19 '05 #8
Lonnie Princehouse wrote:
Welcome to the exciting world of trying to make graphics work on Linux
=)

DRI is direct rendering. [...] DRI not working could also be a permissions issue; check to see if it
works as root.


that's it! :-)

now, how can i make it work as "joe user"?

bye

max

Jul 19 '05 #9
In <q0************ ***********@new s4.tin.it>, max(01)* wrote:
Lonnie Princehouse wrote:
DRI not working could also be a permissions issue; check to see if it
works as root.


that's it! :-)

now, how can i make it work as "joe user"?


I have this in my XF86Config and I'm in the `video` group::

Section "DRI"
Group "video"
Mode 0660
EndSection

Ciao,
Marc 'BlackJack' Rintsch
Jul 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

57
4280
by: John Howard | last post by:
I've sent several messages over the last year asking about python - Who teaches python? Is python losing steam? etc. I have noticed, eg, the declinng number of books at my local borders. The last time I visited a borders (last week), there was 1 (sic) book about python on the shelve compared to dozens on perl & java! On my last inquiry about who teaching python, I got two, maybe three, responses. I really want to see python succeed! It's...
0
1266
by: Fulko van Westrenen | last post by:
Hello, A few days ago I asked help with GLUT/Tk. This combination seems to be difficult. Is there another combination with GLUT, like GTK or Qt, or a true GLUT widget-set that I can use to make buttons,sliders,dials,etc? If there is such a combination, does it come with example code (I learn through examples)? Thanks,
0
2207
by: Bushido Hacks | last post by:
What's that? I've go GCC working for Windows? Well, sort of. But I'm not using a Unix Emulator. The trick is to install Dev-C++, but do not use the Dev-C++ IDE unless you feel like it. I don't use it because I have grow so accustom to using Linux. (GCC rox!) I find GCC to be good because of its simplicity.
1
5618
by: Scott Chang | last post by:
Hi All I tried to use the attached OpenGL code to draw a Star-shaped figure on my Microsoft Visual C++ .NET 2002-Windows XP Pro PC. When I did 'Build' in Debug Mode, I got an error C2065: 'RenderScence': undeclared identifier. Please help and tell me (1) what it is wrong with my coding in this program and how to correct the problem, and (2) whether the functions/commands of the OpenGL v1.1 (existing in Microsoft Visual C++ .NET 2002) and GLUT...
5
14297
by: Michael Kipper | last post by:
Hi, I'm having a problem moving from C to C++. In C, I have a function: void display(void) {} that I can register with OpenGL as a callback using: GLUTAPI void glutDisplayFunc( void (GLUTCALLBACK *func)(void) )
3
9997
by: jg.campbell.ng | last post by:
I'm beginning learning Python and OpenGL in Python. Python fine. But difficulties with OpenGL; presumably with the installation of OpenGL. OS = Linux FC5. Python program gl_test.py: from OpenGL.GLUT import *
1
1632
by: Advait | last post by:
Hello everyone, I am using GCC through DevC++ & Code Block Studio IDEs. I got libraries "gl" & "glu" with these IDEs. Programs based on these two libs gl & glu are executing well. I want to use "glut" library. So I downloaded glut package and copied it to respective folders i.e. to
2
1687
by: Advait | last post by:
Hello everyone, I am using GCC through DevC++ & Code Block Studio IDEs. I got libraries "gl" & "glu" with these IDEs. Programs based on these two libs gl & glu are executing well. I want to use "glut" library. So I downloaded glut package and copied it to respective folders i.e. to include\GL\glut.h
0
1738
by: shortyzms | last post by:
I have been trying to write a small glut program that uses popup context menus on right clicks to draw objects. However, every time I do this, the area underneath the submenu item I clicked does not refresh. Here's a helpful test program I've found from Mindf**k's glut tutorial... #include <iostream> #include <GL/glut.h> #include <cstdlib> using namespace std; void createMenu(void);
0
9594
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10343
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10341
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10089
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9171
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5530
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4308
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.