Re: [PyOpenGL-Users] DrawArrays for a bunch of (unconnected) lines
Brought to you by:
mcfletch
From: Mike C. F. <mcf...@ro...> - 2005-01-31 00:10:54
|
This would be much easier to debug with example code I could run. However, it looks as though the second problem may be related to using a list instead of a string or array with the glVertexPointer variant. That should probably either work or raise a TypeError rather than silently failing. That doesn't explain the problems with the grid, but that looks more like a data issue. You should be aware that you're defining points in 4 dimensions, not 2. That is, the points are x1,y1,z1,w1 as you are passing the parameters into glVertexPointer, not x1,y1,x2,y2, if you've defined them as though they were pairs of 2-coordinate points then the result will likely be dots rather than lines that are way off in the middle of nowhere. Feel free to forward a running example to me. I'll try to get to looking at it sometime this week. Good luck, Mike Philippe Strauss wrote: >Hello, > >I'm playing with opengl for a tiny chart ploting application, >and facing the following problem: > >the line representing the data is displayed, but I cannot >get the horizontal and vertical grid to be displayed. > > ... > glColor(0.8, 0.8, 0.8, 0.0) > glVertexPointerd(self.gridH) > glDrawArrays(GL_LINES, 1, len(self.gridH)) > glVertexPointer(4, GL_DOUBLE, 0, self.gridV) > > You probably meant 2, not 4, here > glDrawArrays(GL_LINES, 1, len(self.gridV)) > glColor(0.65, 1.0, 1.0, 0.0) > #glVertexPointer(2, GL_DOUBLE, 0, self.points) > glVertexPointerd(self.points) > glDrawArrays(GL_LINE_STRIP, 1, self.N/2) > pygame.display.flip() > >self.gridH and gridV are list of 4 elements tuple [(xa0, ya0, xa1, ya1), ...] >self.points is a simple list. > >Also, if I replace glVertexPointerd(self.points) with the line just above it, >nothing is displayed. > >I'm a newbie, someone can probably help me! > >thanks. > > ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |