pyopengl-users Mailing List for PyOpenGL (Page 21)
Brought to you by:
mcfletch
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(81) |
Oct
(41) |
Nov
(55) |
Dec
(14) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(34) |
Feb
(3) |
Mar
(16) |
Apr
(5) |
May
(10) |
Jun
(13) |
Jul
(24) |
Aug
(14) |
Sep
(14) |
Oct
(9) |
Nov
(10) |
Dec
(16) |
2003 |
Jan
(25) |
Feb
(59) |
Mar
(9) |
Apr
(21) |
May
(54) |
Jun
(4) |
Jul
(16) |
Aug
(19) |
Sep
(19) |
Oct
(15) |
Nov
(13) |
Dec
(22) |
2004 |
Jan
(19) |
Feb
(8) |
Mar
(20) |
Apr
(16) |
May
(13) |
Jun
(18) |
Jul
(18) |
Aug
(14) |
Sep
(24) |
Oct
(47) |
Nov
(20) |
Dec
(10) |
2005 |
Jan
(23) |
Feb
(31) |
Mar
(11) |
Apr
(29) |
May
(18) |
Jun
(7) |
Jul
(11) |
Aug
(12) |
Sep
(8) |
Oct
(4) |
Nov
(11) |
Dec
(7) |
2006 |
Jan
(7) |
Feb
(8) |
Mar
(15) |
Apr
(3) |
May
(8) |
Jun
(25) |
Jul
(19) |
Aug
(3) |
Sep
(17) |
Oct
(27) |
Nov
(24) |
Dec
(9) |
2007 |
Jan
(6) |
Feb
(43) |
Mar
(33) |
Apr
(8) |
May
(20) |
Jun
(11) |
Jul
(7) |
Aug
(8) |
Sep
(11) |
Oct
(22) |
Nov
(15) |
Dec
(18) |
2008 |
Jan
(14) |
Feb
(6) |
Mar
(6) |
Apr
(37) |
May
(13) |
Jun
(17) |
Jul
(22) |
Aug
(16) |
Sep
(14) |
Oct
(16) |
Nov
(29) |
Dec
(13) |
2009 |
Jan
(7) |
Feb
(25) |
Mar
(38) |
Apr
(57) |
May
(12) |
Jun
(32) |
Jul
(32) |
Aug
(35) |
Sep
(10) |
Oct
(28) |
Nov
(16) |
Dec
(49) |
2010 |
Jan
(57) |
Feb
(37) |
Mar
(22) |
Apr
(15) |
May
(45) |
Jun
(25) |
Jul
(32) |
Aug
(7) |
Sep
(13) |
Oct
(2) |
Nov
(11) |
Dec
(28) |
2011 |
Jan
(35) |
Feb
(39) |
Mar
|
Apr
(25) |
May
(32) |
Jun
(17) |
Jul
(29) |
Aug
(10) |
Sep
(26) |
Oct
(9) |
Nov
(28) |
Dec
(4) |
2012 |
Jan
(24) |
Feb
(47) |
Mar
(4) |
Apr
(8) |
May
(9) |
Jun
(6) |
Jul
(4) |
Aug
(1) |
Sep
(4) |
Oct
(28) |
Nov
(2) |
Dec
(2) |
2013 |
Jan
(11) |
Feb
(3) |
Mar
(4) |
Apr
(38) |
May
(15) |
Jun
(11) |
Jul
(15) |
Aug
(2) |
Sep
(2) |
Oct
(4) |
Nov
(3) |
Dec
(14) |
2014 |
Jan
(24) |
Feb
(31) |
Mar
(28) |
Apr
(16) |
May
(7) |
Jun
(6) |
Jul
(1) |
Aug
(10) |
Sep
(10) |
Oct
(2) |
Nov
|
Dec
|
2015 |
Jan
(6) |
Feb
(5) |
Mar
(2) |
Apr
(1) |
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
(2) |
Oct
(1) |
Nov
(19) |
Dec
|
2016 |
Jan
(6) |
Feb
(1) |
Mar
(7) |
Apr
|
May
(6) |
Jun
|
Jul
(3) |
Aug
(7) |
Sep
|
Oct
(2) |
Nov
(2) |
Dec
|
2017 |
Jan
|
Feb
(6) |
Mar
(8) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(4) |
Sep
(3) |
Oct
(2) |
Nov
|
Dec
|
2018 |
Jan
(9) |
Feb
(1) |
Mar
|
Apr
|
May
(1) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(6) |
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
(7) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
From: SourceForge.net <no...@so...> - 2012-01-16 21:10:05
|
Feature Requests item #3474542, was opened at 2012-01-16 13:10 Message generated for change (Tracker Item Submitted) made by nobody You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355988&aid=3474542&group_id=5988 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: GL Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: OpenGL ES Support? Initial Comment: Could you please add opengl es support as i would like to use pyopengl with open pandora ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355988&aid=3474542&group_id=5988 |
From: Mike C. F. <mcf...@vr...> - 2012-01-16 17:41:48
|
On 12-01-16 12:32 PM, Hans Wurst wrote: > Hi guys, > > I've written the following wrapper-code for glGetUniformIndices: > > @lazy( glGetUniformIndices ) > def glGetUniformIndices(baseOperation, program, uniformNames): > num = len(uniformNames) > maxLen = max([len(x) for x in uniformNames])+1 > names = ((ctypes.c_char * maxLen) * num)() I believe you want ctypes.c_char_p * num here, with this formulation you'd then need to create a new array of pointers each of which was pointing at the beginning of the row for that value. Don't have a test-case handy to test that assumption, though. > for i,name in enumerate(uniformNames): > names[i].value = name > c_names = ctypes.cast(ctypes.pointer(ctypes.pointer(names)), > > ctypes.POINTER(ctypes.POINTER(OpenGL.constants.GLchar))) > obuff = (ctypes.c_uint32 * num)() > print ctypes.byref(obuff) > print c_names > print "Before", baseOperation.__name__ > baseOperation(program, num, c_names, ctypes.byref(obuff)) > print "After", baseOperation.__name__ > return [o.value for o in obuff] HTH, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |
From: Hans W. <p-e...@we...> - 2012-01-16 17:32:19
|
<html><head></head><body bgcolor='#FFFFFF' style='font-size:10pt;background-color:#FFFFFF;font-family:Verdana, Arial, sans-serif;'>Hi guys,<br/> <br/> I've written the following wrapper-code for glGetUniformIndices:<br/> <br/> @lazy( glGetUniformIndices )<br/> def glGetUniformIndices(baseOperation, program, uniformNames):<br/> num = len(uniformNames)<br/> maxLen = max([len(x) for x in uniformNames])+1<br/> names = ((ctypes.c_char * maxLen) * num)()<br/> for i,name in enumerate(uniformNames):<br/> names[i].value = name<br/> c_names = ctypes.cast(ctypes.pointer(ctypes.pointer(names)),<br/> ctypes.POINTER(ctypes.POINTER(OpenGL.constants.GLchar)))<br/> obuff = (ctypes.c_uint32 * num)()<br/> print ctypes.byref(obuff)<br/> print c_names<br/> print "Before", baseOperation.__name__<br/> baseOperation(program, num, c_names, ctypes.byref(obuff))<br/> print "After", baseOperation.__name__<br/> return [o.value for o in obuff]<br/> <br/> It always segfaults somewhere in my nVidia driver when I try to call it (the print statements are just for debugging). Has anyone ever achieved to call this function from within PyOpenGL? I am sure, that it segfaults because of wrong parameters in the baseOperation call, but I don't know how to call it correctly. Any ideas?<br/> <br/> Cheers <br><br><table cellpadding="0" cellspacing="0" border="0"><tr><td bgcolor="#000000"><img src="https://img.ui-portal.de/p.gif" width="1" height="1" border="0" alt="" /></td></tr><tr><td style="font-family:verdana; font-size:12px; line-height:17px;">SMS schreiben mit WEB.DE FreeMail - einfach, schnell und <br>kostenguenstig. Jetzt gleich testen! <a href="http://f.web.de/?mc=021192"><b>http://f.web.de/?mc=021192</b></a></td></tr></table> </body></html> |
From: Mike C. F. <mcf...@vr...> - 2012-01-16 16:52:40
|
On 12-01-16 11:30 AM, Tony Peña wrote: > Hi > > With this http://www.siafoo.net/snippet/316 i'm try to load in my > QGraphicsView with this code > http://paste.debian.net/152440/ ... and appears the background only > out of QGraphicvsView and not spiral either like this > image http://oi43.tinypic.com/2zftnb9.jpg .. any idea to fix this? Did you remember to call swapBuffers() on the Q GL widget? Good luck, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |
From: Tony P. <emp...@gm...> - 2012-01-16 16:30:45
|
Hi With this http://www.siafoo.net/snippet/316 i'm try to load in my QGraphicsView with this code http://paste.debian.net/152440/ ... and appears the background only out of QGraphicvsView and not spiral either like this image http://oi43.tinypic.com/2zftnb9.jpg .. any idea to fix this? Cheers -- Antonio Peña Secure email with PGP 0x8B021001 available at http://pgp.mit.edu Fingerprint: 74E6 2974 B090 366D CE71 7BB2 6476 FA09 8B02 1001 |
From: Mike C. F. <mcf...@vr...> - 2012-01-15 03:47:18
|
On 12-01-10 09:05 PM, Yuan Xu wrote: ... (Copying list so others know what is going on...) > For switching platform, I think using environment varaiable is a good > idea. Now implemented in bzr head. Variable is PYOPENGL_PLATFORM as proposed. > I improved the code a little by using Constant and adding all OSMesa API. > The patch for bzr is attached. Integrated. > However, I don't know how to create an array (which may be numpy or > numeric) from the ctype pointer, > please take a look at the OSMesaGetDepthBuffer and > OSMesaGetColorBuffer, if we can return a python array it would be nicer. This isn't actually something we do anywhere. When we return arrays/pointers we generally are either asking GL to fill in our array, or we copy the results out. For these OSMesa operations, the GL is returning the actual internal buffers. I've added a TODO regarding supporting such functionality, but in the meantime, if you need to convert the buffers, the numpy.ctypeslib.as_array() function should allow you to do the conversions yourself if you want numpy arrays pointing to the buffers instead of the ctypes pointers. Thanks, Mike > > On Mon, Jan 9, 2012 at 3:33 PM, Mike C. Fletcher > <mcf...@vr... <mailto:mcf...@vr...>> wrote: > > On 12-01-07 04:20 AM, Yuan Xu wrote: > > Hi Alejandro, > > > > Thank you very much for your suggestion. I am using PyQt, > > but I have digged into PyOpenGL, and find a solution: create a > > platform plugin for osmesa. > > I put my patch in github (https://github.com/xuyuan/PyOSMesa), maybe > > others are interested in it. > > > > I will also take a look at QGLPixelBuffer if I have time. > > Hi Yuan, > > I've added your OSMesa platform to OpenGL-ctypes bzr head. The patch > was trivially modified so that the changes that would make OSMesa the > only platform were removed, but I don't yet have anything written to > make it easy to choose a platform to use for a given program. I'm > thinking of using something on the order of os.environ.get( > "PYOPENGL_PLATFORM") where that value being set to a platform key > would > override the default choice. > > Thanks, > Mike > > -- > ________________________________________________ > Mike C. Fletcher > Designer, VR Plumber, Coder > http://www.vrplumber.com > http://blog.vrplumber.com > > > ------------------------------------------------------------------------------ > Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a > complex > infrastructure or vast IT resources to deliver seamless, secure > access to > virtual desktops. With this all-in-one solution, easily deploy virtual > desktops for less than the cost of PCs and save 60% on VDI > infrastructure > costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > <mailto:PyO...@li...> > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > > > > > -- > Best Regards, > > Xu, Yuan -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |
From: Ian M. <geo...@gm...> - 2012-01-14 15:07:54
|
On Sat, Jan 14, 2012 at 4:23 AM, Brice Thurin <bps...@gm...> wrote: > Dear Ian, > > Thank you for your reply. What I do not understand is that most of this > code work fine when I am using Pyopengl with GLUT but it fails when I use > is with a pyglet window? > Dunno. You probably changed something small, or maybe there are small bugs in the PyOpenGL/PyGlet layers that lead to inconsistencies. I am intending to apply a gaussian filter with a shader once I got this bit > working. It is why I am using glFloat. I thought the maximum value in that > case would be 1.0. > Actually, I'm not sure why it wanted something in the range [0.0,255.0]. Perhaps one of those small bugs, eh? Anyway, that refers to the datatype of what you *pass in*. The texture you got almost certainly only has 8-bits duplicated four times, so you got no extra precision. You could use GL_LUMINANCE16 or something, but I recommend you look into using the internal format flags GL_RGB[A]{16|32}F_ARB. These are floating-point texture extensions (import from OpenGL.GL.ARB.texture_float). Note that, if you want to render to them, you need to either specially set up your rendering context (not sure how in PyGlet) or, the better choice, use a framebuffer object. -Don't use GL_LUMINANCE. Use GL_RGB, and GL_RGBA. If you're all for speed >> and are feeling up to it, always use GL_BGRA, because that's often how the >> GPU represents it internally. >> > - Could you tell me why I should not use GL_LUMINANCE > Well, it's not so much that you *shouldn't* use it, as there's no real need. As I said, internally textures are often represented as GL_RGBA (and ALL textures WILL be represented as 4 channels, with almost always 8 bits each). As per the documentation<http://www.opengl.org/sdk/docs/man/xhtml/glTexImage2D.xml>, GL_LUMINANCE duplicates the values. So it would be more clear (and a touch faster at runtime) to just use GL_RGB in the first place. And, if you use GL_RGB, you don't have to worry about writing any extra code when you start wanting to put actual color in your textures. Ian |
From: Brice T. <bps...@gm...> - 2012-01-14 12:23:30
|
Dear Ian, Thank you for your reply. What I do not understand is that most of this code work fine when I am using Pyopengl with GLUT but it fails when I use is with a pyglet window? On 14 January 2012 04:12, Ian Mallett <geo...@gm...> wrote: > Hi, > > Crashes line 36/38 with index out of bounds. Changing the index to 0 in > both cases. > > As to your problem: > -Line 59, you set GL's color to black. Set it to white. > -Scale Z by 255.0 on line 82. > I am intending to apply a gaussian filter with a shader once I got this bit working. It is why I am using glFloat. I thought the maximum value in that case would be 1.0. > > Actually, if this is your first OpenGL program, I'm rather > impressed--you've gotten pretty far. > Well, I found bits and pieces by searching the web. > Tips: > -Change line 38 to not fullscreen. You'll find this is easier to debug. > -Functional programming for right now. OO design just to wrap up some > functions is overkill. > -Be sure to only load your textures once. Take it out of your draw method. > -Don't use GL_LUMINANCE. Use GL_RGB, and GL_RGBA. If you're all for > speed and are feeling up to it, always use GL_BGRA, because that's often > how the GPU represents it internally. > - Could you tell me why I should not use GL_LUMINANCE > -Clean up after yourself with glDeleteTextures. Eventually, you should > make a texture class for all your textures, and you'll put this in its > destructor. > -Check out some tutorials. > > Ian > Many thanks Brice |
From: Ian M. <geo...@gm...> - 2012-01-14 04:12:56
|
Hi, Crashes line 36/38 with index out of bounds. Changing the index to 0 in both cases. As to your problem: -Line 59, you set GL's color to black. Set it to white. -Scale Z by 255.0 on line 82. Actually, if this is your first OpenGL program, I'm rather impressed--you've gotten pretty far. Tips: -Change line 38 to not fullscreen. You'll find this is easier to debug. -Functional programming for right now. OO design just to wrap up some functions is overkill. -Be sure to only load your textures once. Take it out of your draw method. -Don't use GL_LUMINANCE. Use GL_RGB, and GL_RGBA. If you're all for speed and are feeling up to it, always use GL_BGRA, because that's often how the GPU represents it internally. -Clean up after yourself with glDeleteTextures. Eventually, you should make a texture class for all your textures, and you'll put this in its destructor. -Check out some tutorials. Ian |
From: Tony P. <emp...@gm...> - 2012-01-12 23:35:11
|
Hi list, anyone know simple example, to can recreate 3d globe sphere of the earth with 1 texture. and can set 1 position like gps?... with 0, 0 in longitude, latitude?... thanxs for any tips and suggest -- Antonio Peña Secure email with PGP 0x8B021001 available at http://pgp.mit.edu Fingerprint: 74E6 2974 B090 366D CE71 7BB2 6476 FA09 8B02 1001 |
From: Brice T. <bps...@gm...> - 2012-01-11 13:34:30
|
Good Afternoon, I am trying to draw a texture using pyopengl into a pyglet window, but I have not managed to do so for the moment. The reason for using the pyglet window is that it allows me not to have to enter into an infinite loop and it does not block my program. And I am using pyopengl because it is able to deal with floating point numpy array. Below is the code I tried and but could not make it to work. Any advices or suggestions will be greatly appreciated. Regards Brice import OpenGL.GL as gl import OpenGL.GLUT as glut import pyglet import numpy import ctypes from PIL import Image def drawTexture( x , y , w , h ): gl.glBegin( gl.GL_QUADS ) gl.glTexCoord2f( 0, 0 ), gl.glVertex2f( x, y ) gl.glTexCoord2f( 0, 1 ), gl.glVertex2f( x, y + h ) gl.glTexCoord2f( 1, 1 ), gl.glVertex2f( x + w, y + h ) gl.glTexCoord2f( 1, 0 ), gl.glVertex2f( x + w, y ) gl.glEnd() class DisplayImage: def __init__(self , width , height): self._OpenWindow() def _OpenWindow(self): # Find out on which platform it is used. Might not be needed! platform = pyglet.window.get_platform() # List all the screens attached to the computer. display = platform.get_default_display() screens = display.get_screens() template = pyglet.gl.Config(alpha_size=8,double_buffer = True, depth_size=8) config = screens[1].get_best_config(template) self.window = pyglet.window.Window(fullscreen=True, screen = screens[1],config=config) def DrawTexture_image(self, image): # Load texture self.texture_id = gl.glGenTextures( 1 ) gl.glBindTexture( gl.GL_TEXTURE_2D, self.texture_id ) gl.glTexParameterf( gl.GL_TEXTURE_2D, gl.GL_TEXTURE_MIN_FILTER, gl.GL_LINEAR ) gl.glTexParameterf( gl.GL_TEXTURE_2D, gl.GL_TEXTURE_MAG_FILTER, gl.GL_LINEAR ) gl.glTexParameterf( gl.GL_TEXTURE_2D, gl.GL_TEXTURE_WRAP_S, gl.GL_CLAMP_TO_EDGE ) gl.glTexParameterf( gl.GL_TEXTURE_2D, gl.GL_TEXTURE_WRAP_T, gl.GL_CLAMP_TO_EDGE ) gl.glTexImage2D( gl.GL_TEXTURE_2D, 0, gl.GL_LUMINANCE, image.shape[1], image.shape[0], 0, gl.GL_LUMINANCE, gl.GL_FLOAT, image ) gl.glTexEnvf( gl.GL_TEXTURE_ENV, gl.GL_TEXTURE_ENV_MODE, gl.GL_MODULATE ) gl.glClearColor( 1, 1, 1, 1 ) gl.glClear( gl.GL_COLOR_BUFFER_BIT | gl.GL_DEPTH_BUFFER_BIT ) x, y, w, h = gl.glGetIntegerv( gl.GL_VIEWPORT ) gl.glEnable( gl.GL_BLEND ) gl.glBlendFunc ( gl.GL_SRC_ALPHA, gl.GL_ONE_MINUS_SRC_ALPHA ) gl.glColor(0,0,0,1) gl.glEnable( gl.GL_TEXTURE_2D ) gl.glActiveTexture( gl.GL_TEXTURE0 ) gl.glBindTexture( gl.GL_TEXTURE_2D, self.texture_id ) drawTexture(x,y,w,h) self.window.dispatch_event() self.window.flip() if __name__ == '__main__': DisIm = DisplayImage(1000,1000) raw_input("Is it initialising?") def func4( x, y ): return numpy.ceil( x ) + numpy.ceil( y ) x = numpy.linspace( -3.0, 3.0, 800 ) y = numpy.linspace( -3.0, 3.0, 800 ) Z = func4( *numpy.meshgrid( x, y ) ) Z = ( Z - Z.min() ) / ( Z.max() - Z.min() ) DisIm.DrawTexture_image(Z) raw_input("Does it display image?") DisIm.window.close() |
From: Mike C. F. <mcf...@vr...> - 2012-01-09 14:33:19
|
On 12-01-07 04:20 AM, Yuan Xu wrote: > Hi Alejandro, > > Thank you very much for your suggestion. I am using PyQt, > but I have digged into PyOpenGL, and find a solution: create a > platform plugin for osmesa. > I put my patch in github (https://github.com/xuyuan/PyOSMesa), maybe > others are interested in it. > > I will also take a look at QGLPixelBuffer if I have time. Hi Yuan, I've added your OSMesa platform to OpenGL-ctypes bzr head. The patch was trivially modified so that the changes that would make OSMesa the only platform were removed, but I don't yet have anything written to make it easy to choose a platform to use for a given program. I'm thinking of using something on the order of os.environ.get( "PYOPENGL_PLATFORM") where that value being set to a platform key would override the default choice. Thanks, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |
From: Yuan Xu <xuy...@gm...> - 2012-01-07 09:21:16
|
Hi Alejandro, Thank you very much for your suggestion. I am using PyQt, but I have digged into PyOpenGL, and find a solution: create a platform plugin for osmesa. I put my patch in github (https://github.com/xuyuan/PyOSMesa), maybe others are interested in it. I will also take a look at QGLPixelBuffer if I have time. On Fri, Jan 6, 2012 at 11:21 PM, Alejandro Segovia <as...@gm...>wrote: > Hello, > > I remember I struggled with a similar situation back in 2008. It was a > commercial project in C++ and the client had the exact same requirement. > > I ended up solving the issue using Qt, which we were already using anyway. > I believe the class that did the trick was QGLPixelBuffer, but don't take > my word for it, since I've forgotten the details since then. > > If using Qt (PySide/PyQt) is an option for you, I would recommend you have > a look at it. > > Good luck, > Alejandro.- > > 2012/1/6 Yuan Xu <xuy...@gm...> > >> Hi Ian, >> >> Thanks for your reply. >> >> My problem is how to set up OpenGL context without X, because the target >> application will run on a headless Linux server, and generating pictures >> without window. >> >> I think if I have PyOpenGL use Mesa only, then my problem can be solved. >> >> On Fri, Jan 6, 2012 at 12:41 AM, Ian Mallett <geo...@gm...>wrote: >> >>> On Thu, Jan 5, 2012 at 9:31 AM, Yuan Xu <xuy...@gm...> wrote: >>> >>>> Hi all, >>>> >>>> I am trying to use PyOpenGL for off-screen rendering (generating >>>> pictures), AFAIK, OSMesa is the easy (only?) way for this. >>>> >>>> I tried to access OSMesa from python via ctypes, the functions in >>>> OSMesa can be called, but PyOpenGL can not use OSMesaContext, I guess the >>>> problem is my PyOpenGL (from ubuntu rep) was not build on mesa. >>>> >>>> So, my question is how to build PyOpenGL on OSMesa, since I didn't find >>>> any instruction for configuring building. >>>> >>>> Thanks in advance! >>>> >>>> -- >>>> Best Regards, >>>> >>>> Xu, Yuan >>> >>> I'm afraid I can't help with the actual question, but I'd like to remind >>> you that using FBOs for offscren rendering is easier and faster (although >>> you *do* need an OpenGL context to set it up). >>> Ian >>> >> >> >> >> -- >> Best Regards, >> >> Xu, Yuan >> >> >> ------------------------------------------------------------------------------ >> Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex >> infrastructure or vast IT resources to deliver seamless, secure access to >> virtual desktops. With this all-in-one solution, easily deploy virtual >> desktops for less than the cost of PCs and save 60% on VDI infrastructure >> costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox >> _______________________________________________ >> PyOpenGL Homepage >> http://pyopengl.sourceforge.net >> _______________________________________________ >> PyOpenGL-Users mailing list >> PyO...@li... >> https://lists.sourceforge.net/lists/listinfo/pyopengl-users >> >> > > > -- > http://alejandrosegovia.net > > -- Best Regards, Xu, Yuan |
From: Alejandro S. <as...@gm...> - 2012-01-06 22:21:55
|
Hello, I remember I struggled with a similar situation back in 2008. It was a commercial project in C++ and the client had the exact same requirement. I ended up solving the issue using Qt, which we were already using anyway. I believe the class that did the trick was QGLPixelBuffer, but don't take my word for it, since I've forgotten the details since then. If using Qt (PySide/PyQt) is an option for you, I would recommend you have a look at it. Good luck, Alejandro.- 2012/1/6 Yuan Xu <xuy...@gm...> > Hi Ian, > > Thanks for your reply. > > My problem is how to set up OpenGL context without X, because the target > application will run on a headless Linux server, and generating pictures > without window. > > I think if I have PyOpenGL use Mesa only, then my problem can be solved. > > On Fri, Jan 6, 2012 at 12:41 AM, Ian Mallett <geo...@gm...> wrote: > >> On Thu, Jan 5, 2012 at 9:31 AM, Yuan Xu <xuy...@gm...> wrote: >> >>> Hi all, >>> >>> I am trying to use PyOpenGL for off-screen rendering (generating >>> pictures), AFAIK, OSMesa is the easy (only?) way for this. >>> >>> I tried to access OSMesa from python via ctypes, the functions in OSMesa >>> can be called, but PyOpenGL can not use OSMesaContext, I guess the problem >>> is my PyOpenGL (from ubuntu rep) was not build on mesa. >>> >>> So, my question is how to build PyOpenGL on OSMesa, since I didn't find >>> any instruction for configuring building. >>> >>> Thanks in advance! >>> >>> -- >>> Best Regards, >>> >>> Xu, Yuan >> >> I'm afraid I can't help with the actual question, but I'd like to remind >> you that using FBOs for offscren rendering is easier and faster (although >> you *do* need an OpenGL context to set it up). >> Ian >> > > > > -- > Best Regards, > > Xu, Yuan > > > ------------------------------------------------------------------------------ > Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex > infrastructure or vast IT resources to deliver seamless, secure access to > virtual desktops. With this all-in-one solution, easily deploy virtual > desktops for less than the cost of PCs and save 60% on VDI infrastructure > costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > > -- http://alejandrosegovia.net |
From: Yuan Xu <xuy...@gm...> - 2012-01-06 08:34:47
|
Hi Ian, Thanks for your reply. My problem is how to set up OpenGL context without X, because the target application will run on a headless Linux server, and generating pictures without window. I think if I have PyOpenGL use Mesa only, then my problem can be solved. On Fri, Jan 6, 2012 at 12:41 AM, Ian Mallett <geo...@gm...> wrote: > On Thu, Jan 5, 2012 at 9:31 AM, Yuan Xu <xuy...@gm...> wrote: > >> Hi all, >> >> I am trying to use PyOpenGL for off-screen rendering (generating >> pictures), AFAIK, OSMesa is the easy (only?) way for this. >> >> I tried to access OSMesa from python via ctypes, the functions in OSMesa >> can be called, but PyOpenGL can not use OSMesaContext, I guess the problem >> is my PyOpenGL (from ubuntu rep) was not build on mesa. >> >> So, my question is how to build PyOpenGL on OSMesa, since I didn't find >> any instruction for configuring building. >> >> Thanks in advance! >> >> -- >> Best Regards, >> >> Xu, Yuan > > I'm afraid I can't help with the actual question, but I'd like to remind > you that using FBOs for offscren rendering is easier and faster (although > you *do* need an OpenGL context to set it up). > Ian > -- Best Regards, Xu, Yuan |
From: Yuan Xu <xuy...@gm...> - 2012-01-05 17:31:53
|
Hi all, I am trying to use PyOpenGL for off-screen rendering (generating pictures), AFAIK, OSMesa is the easy (only?) way for this. I tried to access OSMesa from python via ctypes, the functions in OSMesa can be called, but PyOpenGL can not use OSMesaContext, I guess the problem is my PyOpenGL (from ubuntu rep) was not build on mesa. So, my question is how to build PyOpenGL on OSMesa, since I didn't find any instruction for configuring building. Thanks in advance! -- Best Regards, Xu, Yuan |
From: Alejandro S. <as...@gm...> - 2011-12-19 16:15:55
|
Hello Alfonso, This might sound obvious, but have you enabled z-buffering? If so, what depth comparison function are you using? Alejandro.- 2011/11/29 Alfonso de la Osa <ar...@gm...> > Hi, > > I'm having troubles with pyopengl (or glut) > when trying to render a glut solid box or glut solid sphere > > > I tried the pyode test and the boxes were wrong. > The faces seem to be invisible sometimes and the render don't show > objects ordered properly in depth. > Then I added spheres and they were erroneously represented too. > > I've taken 2 screenshots: > > http://imgur.com/a/JBm8u > > # draw_body > def draw_body(body): > """Draw an ODE body. > """ > > x,y,z = body.getPosition() > R = body.getRotation() > rot = [R[0], R[3], R[6], 0., > R[1], R[4], R[7], 0., > R[2], R[5], R[8], 0., > x, y, z, 1.0] > glPushMatrix() > glMultMatrixd(rot) > if body.shape=="box": > > glShadeModel(GL_FLAT) > sx,sy,sz = body.boxsize > glScalef(sx, sy, sz) > glutSolidCube(1) > elif body.shape=="sphere": > > glShadeModel(GL_FLAT) > glutSolidSphere(body.radius, 10, 10) > glPopMatrix() > > What can I do to solve this? > > -- > > Alfonso > > > > > > ------------------------------------------------------------------------------ > Learn Windows Azure Live! Tuesday, Dec 13, 2011 > Microsoft is holding a special Learn Windows Azure training event for > developers. It will provide a great way to learn Windows Azure and what it > provides. You can attend the event by watching it streamed LIVE online. > Learn more at http://p.sf.net/sfu/ms-windowsazure > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > > -- http://alejandrosegovia.net |
From: SourceForge.net <no...@so...> - 2011-12-12 08:32:53
|
Feature Requests item #457330, was opened at 2001-08-31 10:51 Message generated for change (Comment added) made by nobody You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355988&aid=457330&group_id=5988 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: v2.1 Status: Closed Resolution: Accepted Priority: 4 Private: No Submitted By: Mike C. Fletcher (mcfletch) Assigned to: Mike C. Fletcher (mcfletch) Summary: Quaternion SLERP Initial Comment: Would be nice to have a Quaternion SLERP function such that firstQuat.SLERP( secondQuat, fraction) would return the appropriate Quaternion representing the fractional rotation between the two Quaternions. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2011-12-12 00:32 Message: ubAYMQ <a href="http://bdeydcoijuan.com/">bdeydcoijuan</a>, [url=http://kmppdxtqjgox.com/]kmppdxtqjgox[/url], [link=http://rygeiwpqancm.com/]rygeiwpqancm[/link], http://uerdbofopiwu.com/ ---------------------------------------------------------------------- Comment By: Mike C. Fletcher (mcfletch) Date: 2002-01-15 19:08 Message: Logged In: YES user_id=34901 Implemented in OpenGLContext/quaternion.py as method Quaternion.slerp(other, fraction, minimalStep) from code in Gamasutra article. ---------------------------------------------------------------------- Comment By: Mike C. Fletcher (mcfletch) Date: 2002-01-15 19:07 Message: Logged In: YES user_id=34901 Implemented in OpenGLContext/quaternion.py as method Quaternion.slerp(other, fraction, minimalStep) from code in Gamasutra article. ---------------------------------------------------------------------- Comment By: Mike C. Fletcher (mcfletch) Date: 2002-01-15 19:06 Message: Logged In: YES user_id=34901 Implemented in OpenGLContext/quaternion.py as method Quaternion.slerp(other, fraction, minimalStep) from code in Gamasutra article. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355988&aid=457330&group_id=5988 |
From: Ian M. <geo...@gm...> - 2011-12-10 00:20:37
|
On Fri, Dec 9, 2011 at 4:43 PM, Alfonso de la Osa <li...@bo...> wrote: > Hi, > > I'm having troubles rendering with pyopengl (or glut) > running on Ubuntu 11.04, Intel GM965/GL960 > when trying to render a glut solid box or glut solid sphere > > I tried the pyode test and the boxes were wrong. > The faces seem to be invisible sometimes and the render don't show > objects ordered properly in depth, the normals sometimes flipped. > Then I added spheres and they were erroneously represented too. > > I've taken 2 screenshots: > > http://imgur.com/a/JBm8u > > this is the code: > > # draw_body > def draw_body(body): > """Draw an ODE body. > """ > > x,y,z = body.getPosition() > R = body.getRotation() > rot = [R[0], R[3], R[6], 0., > R[1], R[4], R[7], 0., > R[2], R[5], R[8], 0., > x, y, z, 1.0] > glPushMatrix() > glMultMatrixd(rot) > if body.shape=="box": > > glShadeModel(GL_FLAT) > sx,sy,sz = body.boxsize > glScalef(sx, sy, sz) > glutSolidCube(1) > elif body.shape=="sphere": > > glShadeModel(GL_FLAT) > glutSolidSphere(body.radius, 10, 10) > glPopMatrix() > > What can I do to solve this? > > Thank you in advance, > > Alf. > The problem is not in the code presented. If it's just the straight test, I can vouch for its correctness, so the problem lies outside the code. Has the code been modified from the sample? It looks like depth testing is disabled--or maybe there's no depth buffer in the first place. Make sure there's NOT a "glDisable(GL_DEPTH_TEST)" anywhere. As I recall, the sample is based on PyGame. You might have to explicitly request a depth buffer (i.e., "pygame.display.gl_set_attribute(GL_DEPTH_SIZE,8)" xor 16, 24, xor 32). If the code is just the sample code, the problem is almost certainly your GPU. Intel (graphics) chipsets just plain suck. Everyone in the graphics industry knows this. Including Intel. They have dodgy hardware support at best. In my tests, some chips don't even support OpenGL core specification that's been in place for more than a decade. That said, the internet has some suggestions. For instance, perhaps updating Mesa. Ian |
From: Alfonso de la O. <li...@bo...> - 2011-12-09 23:43:54
|
Hi, I'm having troubles rendering with pyopengl (or glut) running on Ubuntu 11.04, Intel GM965/GL960 when trying to render a glut solid box or glut solid sphere I tried the pyode test and the boxes were wrong. The faces seem to be invisible sometimes and the render don't show objects ordered properly in depth, the normals sometimes flipped. Then I added spheres and they were erroneously represented too. I've taken 2 screenshots: http://imgur.com/a/JBm8u this is the code: # draw_body def draw_body(body): """Draw an ODE body. """ x,y,z = body.getPosition() R = body.getRotation() rot = [R[0], R[3], R[6], 0., R[1], R[4], R[7], 0., R[2], R[5], R[8], 0., x, y, z, 1.0] glPushMatrix() glMultMatrixd(rot) if body.shape=="box": glShadeModel(GL_FLAT) sx,sy,sz = body.boxsize glScalef(sx, sy, sz) glutSolidCube(1) elif body.shape=="sphere": glShadeModel(GL_FLAT) glutSolidSphere(body.radius, 10, 10) glPopMatrix() What can I do to solve this? Thank you in advance, Alf. |
From: Ian M. <geo...@gm...> - 2011-11-30 21:18:22
|
On Tue, Nov 29, 2011 at 11:41 AM, Derakon <de...@gm...> wrote: > I have a program that's intended to display the output of a scientific > camera -- a ~2500x~2000 greyscale image. This exceeds the maximum > texture size on the target computer, so I split the image into smaller > tiles which are displayed side-by-side. I wrote up a test application > which works fine on my OSX laptop, but not on the (Windows 7) target > computer. The problem I'm seeing is that every tile is showing what > the last tile is supposed to show. So for example if I render tiles at > (0, 0), (0, 1), (1, 0), and (1, 1), then all of the tiles will display > the content from the (1, 1) tile. > > Here's the test app: http://pastebin.com/yEaeLUNv > It depends on wxPython, pyOpenGL, and numpy. Everything up to line 121 > is WX glue code and can be ignored (the sample image is generated at > line 10, if you care). The OnPaint function there calls the render() > method for each Image class instance; those Images then render > individual tiles. I apologize for the inconsistent code style and use > of deprecated OpenGL features; this is a mishmash of old and new-ish > code from multiple authors. > > Any ideas what I'm doing wrong? Or how I'd go about figuring this out? > I've yet to figure out how to effectively debug errors in my usage of > OpenGL. > > -Chris Hi, You're right; the code definitely needs cleaning up. .bindTexture actually makes the OpenGL texture object? What? As to the problem, I'm not seeing anything immediate in the code. However, if it works on one piece of hardware and not on another, that's the variable. The rule of debugging is to look at the difference. Even my aging laptop (which was middle-end when new) supports 4096x4096 textures. If your Windows box doesn't, I'm guessing there are other problems, like not supporting non-POT textures, or simply not having enough memory to store the thing. Both of these might lead to the problem you're experiencing. So, in conclusion, compare GPUs. Ian |
From: Alfonso de la O. <ar...@gm...> - 2011-11-29 20:10:28
|
Hi, I'm having troubles with pyopengl (or glut) when trying to render a glut solid box or glut solid sphere I tried the pyode test and the boxes were wrong. The faces seem to be invisible sometimes and the render don't show objects ordered properly in depth. Then I added spheres and they were erroneously represented too. I've taken 2 screenshots: http://imgur.com/a/JBm8u # draw_body def draw_body(body): """Draw an ODE body. """ x,y,z = body.getPosition() R = body.getRotation() rot = [R[0], R[3], R[6], 0., R[1], R[4], R[7], 0., R[2], R[5], R[8], 0., x, y, z, 1.0] glPushMatrix() glMultMatrixd(rot) if body.shape=="box": glShadeModel(GL_FLAT) sx,sy,sz = body.boxsize glScalef(sx, sy, sz) glutSolidCube(1) elif body.shape=="sphere": glShadeModel(GL_FLAT) glutSolidSphere(body.radius, 10, 10) glPopMatrix() What can I do to solve this? -- Alfonso |
From: Derakon <de...@gm...> - 2011-11-29 18:41:44
|
I have a program that's intended to display the output of a scientific camera -- a ~2500x~2000 greyscale image. This exceeds the maximum texture size on the target computer, so I split the image into smaller tiles which are displayed side-by-side. I wrote up a test application which works fine on my OSX laptop, but not on the (Windows 7) target computer. The problem I'm seeing is that every tile is showing what the last tile is supposed to show. So for example if I render tiles at (0, 0), (0, 1), (1, 0), and (1, 1), then all of the tiles will display the content from the (1, 1) tile. Here's the test app: http://pastebin.com/yEaeLUNv It depends on wxPython, pyOpenGL, and numpy. Everything up to line 121 is WX glue code and can be ignored (the sample image is generated at line 10, if you care). The OnPaint function there calls the render() method for each Image class instance; those Images then render individual tiles. I apologize for the inconsistent code style and use of deprecated OpenGL features; this is a mishmash of old and new-ish code from multiple authors. Any ideas what I'm doing wrong? Or how I'd go about figuring this out? I've yet to figure out how to effectively debug errors in my usage of OpenGL. -Chris |
From: Maximiliano G. <max...@gm...> - 2011-11-13 20:55:58
|
Thank you so much! As I said I just started learning graphics programming, even the pipeline is still confusing to me. This is just one more detail I didn't knew. Sorry for taking so long to respond, thanks again! On Tue, Nov 8, 2011 at 2:20 AM, Mike C. Fletcher <vrp...@gm...>wrote: > On 11-11-06 11:31 AM, Maximiliano Guerra wrote: > > Hi all, this is my first message in this list. Nice to meet you all. > > I just started learning Computer Graphics. I'm studying in the > http://www.arcsynthesis.org/gltut > It is very good for graphics concepts as well opengl, their code is in c++ > but I'm wanting to do it with python. > > So I'm tring to do the first tutorial (you can find the code here: > bitbucket.org/alfonse/gltut) step by step and I ran in some problems with > glGenBuffers. > > In [1]: from OpenGL.GL import * > > In [2]: buf = glGenBuffers(1) > NullFunctionError: Attempt to call an undefined function glGenBuffers, > check for bool(glGenBuffers) before calling > > ... > > Your code is attempting to call OpenGL-context requiring code without an > OpenGL context (window). Do the glGenBuffer and similar calls within a > draw callback of your windowing system (e.g. GLUT). You may also need to > verify that your machine has a reasonably recent video card that supports > modern OpenGL (but most do these days). > > HTH, > Mike > > -- > ________________________________________________ > Mike C. Fletcher > Designer, VR Plumber, Coder > http://www.vrplumber.com > http://blog.vrplumber.com > > > > ------------------------------------------------------------------------------ > RSA(R) Conference 2012 > Save $700 by Nov 18 > Register now > http://p.sf.net/sfu/rsa-sfdev2dev1 > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > > -- Maximiliano Guerra de Medeiros |
From: Mike C. F. <mcf...@vr...> - 2011-11-10 04:55:10
|
On 11-11-09 10:42 PM, Gordon Wrigley wrote: > Enabling error checking did not change that particular failure. > > Are you suggesting that that machine may not have glBindVertexArray? > That's a core function and the driver reports itself as 3.3.0 via > glxinfo and lets me acquire a core 3.3 context via pyopengl glut. Hmm, no, was suggesting that your machine was not providing a result from glGetString() because core doesn't support that, and instead wants you to use glGetStringi. However, if the result is not changing with error checking then my assumption is wrong. Possibly your driver is just ignoring the bad request, but not signalling an error? Well, something to guard against no matter what... and when I look at it, there *is* a guard against it that I would have expected to be in the current release (that is, AttributeError is explicitly checked on that line in the code). A bit stumped on that one, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |