473,781 Members | 2,702 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

GUI development with 3D view

Hi,

I'm looking for quite some time now for a gui library for python,
which allows me to display 3D graphics. Main OS is windows, Mac OS X
and Linux would be nice to have. I want to use python 2.5. My first
try was wx + pyOpenGL but there are no working binaries for python
2.5. I simply have to display some dialogs for data input and a 3D
scene with lots of arrows. No fancy mesh and scene handling is needed.

Is there an alternative to wx+pyOpenGL?

regards,
Achim
Dec 10 '07 #1
11 2196
Achim Domma wrote:
Hi,

I'm looking for quite some time now for a gui library for python,
which allows me to display 3D graphics. Main OS is windows, Mac OS X
and Linux would be nice to have. I want to use python 2.5. My first
try was wx + pyOpenGL but there are no working binaries for python
2.5. I simply have to display some dialogs for data input and a 3D
scene with lots of arrows. No fancy mesh and scene handling is needed.

Is there an alternative to wx+pyOpenGL?
The usual suspects - mainly Qt, possibly Tk (not sure if there is a
python-available version of open gl canvasses for Tk)

Diez
Dec 10 '07 #2
Diez B. Roggisch wrote:
Achim Domma wrote:
[snip]
>>
Is there an alternative to wx+pyOpenGL?

The usual suspects - mainly Qt, possibly Tk (not sure if there is a
python-available version of open gl canvasses for Tk)

Diez
togl is a Tk/OpenGL widget that can be used with python as well. I
think it is included in PyOpenGL. It is quite easy to use iirc, but
I've got no idea how it works with windows.
Dec 10 '07 #3
Hi!
no idea how it works with windows.
On XP: fine.
On Vista: very difficult...

@+

MCI
Dec 10 '07 #4
Méta-MCI (MVP) wrote:
>no idea how it works with windows.

On XP: fine.
On Vista: very difficult...
Hello Captain Obvious :-)
Dec 10 '07 #5
On 10 Dez., 15:24, "Méta-MCI \(MVP\)"
<enleverlesX.X. ..@XmclaveauX.c omwrote:
Hi!
no idea how it works with windows.

On XP: fine.
On Vista: very difficult...

@+

MCI
Also with Python 2.5? If PyOpenGL would work with Python 2.5, I could
use wx too. But I could not get it to work with 2.5 on windows.

Achim
Dec 10 '07 #6
Achim Domma wrote:
On 10 Dez., 15:24, "Méta-MCI \(MVP\)"
<enleverlesX.X. ..@XmclaveauX.c omwrote:
>Hi!
no idea how it works with windows.

On XP: fine.
On Vista: very difficult...

@+

MCI

Also with Python 2.5? If PyOpenGL would work with Python 2.5, I could
use wx too. But I could not get it to work with 2.5 on windows.
I was under the impression that PyOpenGL is ctypes-based in the new
versions?

Diez
Dec 10 '07 #7
Diez B. Roggisch wrote:
....
I was under the impression that PyOpenGL is ctypes-based in the new
versions?
It is, but I haven't had the time to do a new release and check it on a
Windows box. There are minor fixes in CVS that *should* IIRC make us
run better on those Windows machines that have problems with the 3.x
alphas so far.

Tempus fugit,
Mike

--
_______________ _______________ _______________ ___
Mike C. Fletcher
Designer, VR Plumber, Coder
http://www.vrplumber.com
http://blog.vrplumber.com

Dec 10 '07 #8
Re!

On Vista, OpenGL depend of (releases of) video-cards.
Some cards don't support OpenGL =problem!
Some cards have native openGL support =good (dream?)
Some cards need update (drivers)

@-salutations

Michel Claveau

Dec 10 '07 #9
On 10 Des, 13:33, Achim Domma <do...@procoder s.netwrote:
I'm looking for quite some time now for a gui library for python,
which allows me to display 3D graphics. Main OS is windows, Mac OS X
and Linux would be nice to have. I want to use python 2.5. My first
try was wx + pyOpenGL but there are no working binaries for python
2.5.
Huh? The latest version of PyOpenGL uses ctypes and has no binaries as
it is implemented in pure Python. Personally I use my own ctypes
wrapper for the few OpenGL routines I need. There is a lot of unwanted
overhead in PyOpenGL.

Also consider calling OpenGL from a Pyrex extension. That may save you
some overhead if you make a lot of calls to the OpenGL library. A
remedy for that may be to use display lists, or combine vertex arrays
or vertex buffers with NumPy arrays.
Excerpts from my OpenGL wrapper:

from ctypes import *
import numpy
from threading import Lock
opengl_lock = Lock()
GL = windll.opengl32
GLU = windll.glu32

GL_PROJECTION = 0x1701
GL_MODELVIEW = 0x1700
GL_DEPTH_TEST = 0x0B71
GL_VERTEX_ARRAY = 0x8074
GL_NORMAL_ARRAY = 0x8075

glBegin = GL.glBegin
glBegin.argtype s = (c_int,)
glBegin.restype = None

glEnd = GL.glEnd
glEnd.argtypes = ()
glEnd.restype = None

glVertex3f = GL.glVertex3f
glVertex3f.argt ypes = (c_float, c_float, c_float)
glVertex3f.rest ype = None

gltypemap = {
GL_BYTE : numpy.ctypeslib .ndpointer(dtyp e = numpy.int8,
flags='aligned, contiguous'),
GL_UNSIGNED_BYT E : numpy.ctypeslib .ndpointer(dtyp e = numpy.uint8,
flags='aligned, contiguous'),
GL_SHORT : numpy.ctypeslib .ndpointer(dtyp e = numpy.int16,
flags='aligned, contiguous'),
GL_UNSIGNED_SHO RT : numpy.ctypeslib .ndpointer(dtyp e =
numpy.uint16, flags='aligned, contiguous'),
GL_INT : numpy.ctypeslib .ndpointer(dtyp e = numpy.int32,
flags='aligned, contiguous'),
GL_UNSIGNED_INT : numpy.ctypeslib .ndpointer(dtyp e = numpy.uint32,
flags='aligned, contiguous'),
GL_FLOAT : numpy.ctypeslib .ndpointer(dtyp e = numpy.float32,
flags='aligned, contiguous'),
GL_DOUBLE : numpy.ctypeslib .ndpointer(dtyp e = numpy.float64,
flags='aligned, contiguous'),
GL_UNSIGNED_BYT E_3_3_2 : numpy.ctypeslib .ndpointer(dtyp e =
numpy.uint8, flags='aligned, contiguous')
}

def glVertexPointer (size, gltype, stride, array):
opengl_lock.acq uire()
glfun = GL.glVertexPoin ter
glfun.argtypes = (c_int, c_int, c_int, gltypemap[gltype])
glfun.restype = None
glfun(size, gltype, stride, array)
opengl_lock.rel ease()

def glGenBuffersARB (n):
opengl_lock.acq uire()
PFNGLGENBUFFERS ARBPROC = WINFUNCTYPE(Non e, c_uint,
gltypemap[GL_UNSIGNED_INT])
wglGetProcAddre ss = GL.wglGetProcAd dress
wglGetProcAddre ss.argtypes = (c_char_p,)
wglGetProcAddre ss.restype = PFNGLGENBUFFERS ARBPROC
glfun = wglGetProcAddre ss('glGenBuffer sARB')
buffers = numpy.zeros(n, dtype=numpy.uin t32)
glfun(n, buffers)
opengl_lock.rel ease()
return buffers
Interfacing Python with OpenGL is not rocket science.



Dec 11 '07 #10

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

Similar topics

28
3090
by: Me | last post by:
I would like to redesign my existing site into php using classes. I am not the most experienced developer with PHP, and would like to know if anyone can give me some input on a starting point for a class library. Basically, the idea is to have as much of the content served dynamically, using a mySQL database. My catalog site has grown to over 1,100 pages, and is continuing to grow. It's getting ridiculous to keep performing manual...
1
1810
by: Henry Reardon | last post by:
I have been having problems with the Development Center for several days now. It seemed to be working fine when I initially installed DB2 (LUW) Version 8 (FP7) and upgraded to FP8, except that I kept getting SQL1131 whenever I tried to prepared a stored procedure. As a result, I completely deleted DB2 and reinstalled version 8 and upgraded to FP8. At that point, I experimented a bit with some of the Environment Settings, particularly the...
2
1610
by: SpotNet | last post by:
Hi NewsGroup, Currently constructing a MDI application with tree view functionality. That is to say my application will look something like Windows Explorer with the ability to view data and graphs in separate MDI child windows depending on the options chosen. I have a MDI child window with the tree view control on one side and listview, custom input screen controls on the other side separated by a splitter control, which become...
8
1780
by: Jacob Crossley | last post by:
Preface: Not to sound mean or arrogant, but please don't answer this question unless you have a specific and tested answer. I'm saying this only because I posted the same quesion earlier and got spammed by this so-called Microsoft MVP that gave me a very vague answer, followed by a series of incorrect answers that I had already mentioned were tried, tested and failed. Sorry I had to start my post like that : - ) but here goes my actual...
16
1910
by: Linus | last post by:
Being a ASP developer for a consultant company thinking of starting developing with ASP.NET I have read literally hundreds of web pages and posts in discussion forums on the Internet to get an idea of what we will need to adapt to. I have read Microsoft’s “Team Development with Visual Studio .NET and Visual SourceSafe†and tried to set up a development environment as recommended using the “Isolated modelâ€. However, many questions...
31
3026
by: Cy | last post by:
Hi all, I wanted to start a thread that might help many of us. I worked for a company for 12 years, until this past Christmas when they let me go. Getting rid of the higher dollar guys, in favor of more profit, was the reasoning. Oh well. Anyhow. I built this companies network from the ground up. Then about 8 years ago, I developed a MS Access 2.0 database. This database, much like others, was supposed to just tiny bits. Over...
4
2949
by: Richard Levasseur | last post by:
(Forewarning, most of these problems and solutions come from being the only developer in a 1 server department with no budget, few resources, unresponsive IT, and non-technical managers, so thats where I'm coming from.) (Additionally, this may or may not fit in this group, but I know there's bright people here, and it is largely PHP development centric) Any time I've done web development, I've always been plagued by some of the...
10
2445
by: Michael B. Trausch | last post by:
Alright, I seem to be at a loss for what I am looking for, and I am not even really all that sure if it is possible or not. I found the 'pdb' debugger, but I was wondering if there was something that would trace or log the order of line execution for a multi-module Python program. I am having a little bit of a problem tracking down a problem that I mentioned earlier (http://groups.google.com/group/comp.lang.python/msg/9c759fc888b365be),...
1
1114
by: =?Utf-8?B?ZGF2aWQ=?= | last post by:
I did development by using .NET 2003 (enterprise edition) which does not have tree view control for web form, and SQL server 2000 installed on the same machine with server 2000 operating system. Now I have to move the server machine to other place, and I will get a new machine for myself for developing Web Server applications which will be installed in the server machine. So I have to remotely access the the server machine. I just think...
0
9639
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9474
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
10308
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10143
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...
0
9939
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
6729
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5507
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3633
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2870
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.