Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jan 31 2019 12:12
    eyildiz-ugoe edited #197
  • Jan 31 2019 12:09
    eyildiz-ugoe opened #197
  • Jan 30 2019 13:54
    trdavidson starred glumpy/glumpy
  • Jan 29 2019 15:23
    wellkao starred glumpy/glumpy
  • Jan 29 2019 12:22
    ezerchen starred glumpy/glumpy
  • Jan 29 2019 06:11
    fancyoung starred glumpy/glumpy
  • Jan 29 2019 06:08
    maty974 starred glumpy/glumpy
  • Jan 29 2019 05:30
    crackevil starred glumpy/glumpy
  • Jan 29 2019 04:30
    fjdu starred glumpy/glumpy
  • Jan 29 2019 04:22
    Rady starred glumpy/glumpy
  • Jan 29 2019 03:29
    cderong starred glumpy/glumpy
  • Jan 28 2019 12:37
    Felipeasg starred glumpy/glumpy
  • Jan 28 2019 08:16

    rougier on master

    "Open GL" -> "OpenGL" in docs. Merge pull request #196 from se… (compare)

  • Jan 28 2019 08:16
    rougier closed #196
  • Jan 27 2019 18:17
    sebftw opened #196
  • Jan 27 2019 15:22
    King-Of-Knights starred glumpy/glumpy
  • Jan 27 2019 14:43
    inoryy starred glumpy/glumpy
  • Jan 26 2019 08:50
    kashif starred glumpy/glumpy
  • Jan 26 2019 03:11
    mlviz commented #177
  • Jan 26 2019 03:02
    mlviz commented #177
David Pineda
@pineiden_gitlab
Thanks Nicolás!
Si a beautifull book!
HukamiEstia
@HukamiEstia
Hi, I want to draw multiple 3D boxes with different translation and rotation, to do that I started from the outlined cube example and I am trying to use transforms to specify the translation and rotation, I was able to use the Rotate transform but not the Translate. Also is it possible to combine multiple transform (rotate the box then translate it) ?
here is the main from my vertex shader :
gl_Position = u_projection * u_view * u_model * vec4(<transform(position)>, 1.0);
and here is how I define the transform:
cube["transform"] = Translate(translate=(0,0,0))
which doesn't work, but if I use :
cube["transform"] = Rotate(angle=30)
it works... I must be missing something but I'm still a beginner concerning OpenGL stuffs
HukamiEstia
@HukamiEstia
Ok so it was because of a syntax error in translate.glsl which was corrected 25days ago in commit 580a1e8 but isn't in the pip install yet. Now it's working.
Also, I managed to combine multiple transforms:
vertex = """
attribute vec3 position;
vec4 rotation;
vec4 translation;
void main()
{
rotation = vec4( <rotate(position)>, 1.0);
translation = <translate>;
gl_Position = <transform>;
}
"""
cube["rotate"] = Rotate(angle=30)
cube["translate"] = Translate("rotation", translate=(0.5,0,0))
cube["transform"] = PVMProjection("translation")
HukamiEstia
@HukamiEstia
If there is a better way please let me know
jcyc
@jcyc
Hi,I use ten data csv file(each 3 col*2,000,000 row) with glumpy path or polygons function to drawing ,but I find out path or polygons function append one data array need more 10 secs ,I had trans csv to numpy array before append data, is possible any way to speed up 'append ' process ?ex: make file before then load ? or other ways, pls give me some direction, many thanks.
Lucas Menicucci
@lsmenicucci
Hey guys, could you give me a little help? I'm leaning the basics of OpenGL for making animated quiver plots and I can't understand very well the vertex and fragment shaders of this example https://www.labri.fr/perso/nrougier/python-opengl/#id37. In that example only 4 vertexes can create a bunch of arrows, I can't understand how that's possible. Furthermore, wouldn't be necessary at least 4N floats for drawing N 2D arrows?
Julio Vera
@nekonekno
Hey everybody! i'm trying to run the examples of the main page, without success. I have an Arch Linux installation with python 3.10 and Jupyter, and the output send me the following error:
object of type 'NoneType' has no len()
Any suggestions? Thank you!
QiuJiangkun
@qiujiangkun
Is there any follow up with newer version of numpy?
I have fixed some minor errors manually
Benoit Tachet
@benoittachet
Capture d’écran de 2020-12-02 09-22-43.png

Hi,

I'm trying to use glumpy to display some figures using transparency, and I am wondering about one thing that I discovered using one of the examples :
I'm currently using the cube example (solid-cube.py), and I wanted to change the alpha of its color. However, doing so makes the faces sometimes look different according to the rotation angle, like on this image :

Would anyone have an idea about why this does happen ?
Le minaw
@LeMinaw

Would anyone have an idea about why this does happen ?

Hard to say without manipulating the actual program
Note you have some exemples of OIT (order independant transparency) implementation there: https://github.com/glumpy/glumpy/tree/master/examples/transparency

Peter Vince
@pvince99_twitter
I'm trying to draw several objects, all of the same type, each with rotation and translation and specified colour. Should I use Collections as I can't seem to get it working otherwise? Are there examples to look at?
glumpyfan101
@glumpyfan101
image.png
Hi! First of all: fantastic project and excellent book/tutorial. I have tried to use this module for some time, my end goal is to use it for visualizing CFD-calculations. Anyways: Right now I am trying to learn about buffering data to the GPU. I find the documentation a little sparse. The goal with the above code is to write a program that gives the GPU some data which the GPU then performs some sort of calculation on, after which I reach into the buffered memory and get the calculated data out. It runs without crashing, but does not seem to return correct values. Anyone able to give me a hint as to what is wrong? I am obviously an amature at this, and there is probably something conceptually really wrong here.
Nicolas P. Rougier
@rougier
To read data from the GPU, you'll need to use a framebuffer. There are some examples in the source directory.
Alex Sizov
@SizovAlex_gitlab
Hello
I need to visualization a 3D numpy array with a size of 900x900x100. The value of the array elements is 0 ... 255. Can someone share an example for this type of visualization?
venkatbalaji221
@venkatbalaji221
I am trying to create a basic "Hello world Triangle" using glumpy. I am getting a triangle when vertices are only among four corner points of the frame and in other cases, the entire screen is getting cleared(Insted of getting a small triangle inside the frame). what changes needed to be done? (Even not working for quad drawing given in documentation)
image.png
image.png
PauliX51
@PauliX51
Hey, I am trying to create a visualization where I would also like to add some labels using texts and fonts as described here: https://glumpy.readthedocs.io/en/latest/examples-text.html. The problem that I have is, that the text is only displayed once after I opened a new terminal. So what actually happens is that everything works fine the first time I run the program but if I close the window and re-run the program in the same terminal, the labels won't be displayed anymore. What I have to do is opening a new terminal and run the program there so that the labels are displayed again. Is there any way to avoid this? Thanks in advance!
pumplerod
@pumplerod
Hello, I came across glumpy because I'm trying to convert samples from a data set into images. I have been using matplotlib in my test however it is far too slow to perform on millions of samples. Glumpy seems promising. I'm never actually viewing the images created, I'm feeding them into a neural network for feature extraction with convolution, so what I really need to do is get the image data from the framebuffer to pass into the neural net. I can't find, in the documentation, a method for extracting the framebuffer data. Am I incorrect in thinking glumpy would be suitable for this purpose?
Hiro Protagonist
@hiroprotagonist84:matrix.org
[m]

I'm looking for an example where one inherits from app.Window instead of using the @window.* decorators.

I tried this, and my on_draw is never called:

class TestWindow(app.Window):
    def __init__(self,  *args, **kwargs):
        print(args, kwargs)
        super().__init__(*args, **kwargs)
        print(self)
        console = app.Console(rows=10, cols=80, scale=4, color = (1.0,1.0,1.0,1) )
        console._default_foreground = 1,0,1,1
        console._default_background = 0,1,0,1
        self.console = console
        self.attach(console)

    def on_draw(self, dt):
        print("on_draw")
        try:
            window = self
            window.clear()
            console = self.console
            console.clear()
            console.write("hello world")
            console.draw()
            print("here")
        except:
            logger.exception("draw")
Dhawal S
@dhawal1939

Hey, I am trying to write the contents of the CUDA buffer onto the torch tensor based on the example given here.
The example is very insightful but does the task in reverse. I have altered the
Functions set_src_device -> set_src_array and set_dst_array -> set_dst_array
Unfortunately, I am unable to retrieve the data correctly. I have torch tensor of type 'f4' and texture also created with type 'f4' instead of 'uint8' as given in the example.
https://gist.github.com/victor-shepardson/5b3d3087dc2b4817b9bffdb8e87a57c4

Can anyone let me know why?!

Nicolas P. Rougier
@rougier
Best would be top open an isue on GitHub with a precse decription of the problem/output
Dhawal S
@dhawal1939
OK
ShannonZ
@ShannonZ
Is it possible to integrate glumpy with kivy?
Nicolas P. Rougier
@rougier
I'm not familia enough with kivy to give you an answer. If kivy provide a GL context, that could be possible. It woul require to run the glumpy event loop manually but there is an example in the examples directory.
rubioh
@rubioh

Hello, I have a small problem with glumpy and I did not find an answer on the internet so I take the liberty of asking my question here. I would like to call several programs at different times. For example, every 10 seconds I want my window to change the program that is called. For this I have built a list of programs and I simply iterate over the programs in my list. However, only the first program in the list is displayed correctly, then I have a black screen for all the other programs and the window reactivates when I come back to the first program. If someone can help me that would be really great. Thanks in advance!

Translated with www.DeepL.com/Translator (free version)

sorry for the deepl translation :O
rubioh
@rubioh
I found the problem, my on resize function was not called when I changed the program. Thanks anyway! And thanks for glumpy, this library is really useful for me.
Kevin B Kenny
@kennykb
Can anyone point me to an example of using the Trackball transformation with a viewport smaller than the window? So far, everything I've tried either corrupts the aspect ratio or fails to respond to the mouse. The closest I've come was to set up the viewport with code borrowed from examples/snippet-viewport.py. It gave a decent looking image at first, but any trackball motion simply flipped the image 180°. I'm pretty sure it's the event wiring that I've got wrong. The vertex shader is pretty trivial - gl_Position=trackball(a_position); <viewport.transform>; and the fragment shader begins with <viewport.clipping>. Everything is fine if I use the default viewport, or if I constrain the viewport and don't wire the trackball.
Kevin B Kenny
@kennykb
Got it - I have to NOT attach either viewport or trackball to the main window, and instead implement on_resize, on_mouse_drag and on_mouse_scroll. on_resize has to hand the sub-viewport size to the trackball, and set viewport('global'] and viewport['extents']. on_mouse_drag and on_mouse_scroll both check if (x,y) is in the extent, and only then do transform.on_mouse_drag and transform.on_mouse_scroll. Seems as if it oughtn't to be this hard, but at least that part of my program is working now.