Hi!
Im making a spectrum analyzer and Im having some issues trying to graph the data thats coming out of it. I need to map triplets (x,y,z) to pixels in a screen where the values x and y correspond to spatial coordinates and the value z corresponds to a shade of gray. I found a way to do it, but it involves making an abstraction that includes one object per pixel on the screen! Im pretty sure there is an easier way to do it. Any ideas?
-
Mapping triplets of integers to pixels
-
look into the GEMgl objects for this low level stuff, specifically:
[gemhead] [loadbang]
[t a a a] [GLdefine GL_POINTS]
| | [GEMglBegin]
[GEMglEnd]
|
[repeat 100] <--- or some other method if you don't want to use zexy
|
[t a b] <-- count the bangs, use them to look up or calculate the triplets
|
[GEMglColor3f] <--- feed the grey to all 3 colour inlets
|
[GEMglVertex2f] <--- feed the x and y here