how to draw a matrix of color values?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

how to draw a matrix of color values?

rtayek
hi, i have a 1024x1024 matrix of java.awt.Colors. i want to draw this to the screen.

this is a 2d app that will run on a windows 7 pc with a good graphics card.

should i use draw array, draw pixels, or make an image?

thanks
Reply | Threaded
Open this post in threaded view
|

Re: how to draw a matrix of color values?

gouessej
Administrator
Hi

I would make an image and use it as a texture or (better) use a vertex buffer object containing vertices and colors.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: how to draw a matrix of color values?

rtayek
At 03:37 AM 8/29/2012, you wrote:
>Hi I would make an image and use it as a texture or (better) use a
>vertex buffer object containing vertices and colors.
>Julien Gouesse

ok. i will try a vertex buffer object.

thanks

---
co-chair http://ocjug.org/

Reply | Threaded
Open this post in threaded view
|

Re: how to draw a matrix of color values?

gouessej
Administrator
Good idea, it allows to treat bigger cases. If you need some ideas to optimize such a stuff, let me know. For example, you may want to merge adjacent triangles or quads of the same color. I use something similar (but more complicated) in one of my algorithms.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: how to draw a matrix of color values?

rtayek
At 12:56 AM 8/30/2012, you wrote:
>Good idea, it allows to treat bigger cases. If you need some ideas
>to optimize such a stuff, let me know.

thanks for the kind offer. i'm sure i will, but right now i am just
trying to get a few examples of vbo to work, so i can put it in my
code. i did get someone's vbo test to work and am still working on
the nehe lesson 45.

>  For example, you may want to merge adjacent triangles or quads of
> the same color. I use something similar (but more complicated) in
> one of my algorithms.

i have 8 1024x1024 matrices of 6-bit intensity values. they will need
to be blended and drawn to the screen. the data in them changes over
time, so i am planning on using dynamic draw.

thanks


---
co-chair http://ocjug.org/

Reply | Threaded
Open this post in threaded view
|

Re: how to draw a matrix of color values?

gouessej
Administrator
rtayek wrote
i have 8 1024x1024 matrices of 6-bit intensity values. they will need
to be blended and drawn to the screen. the data in them changes over
time, so i am planning on using dynamic draw.
Dynamic VBOs fit into your needs. However, such an hint is ignored on the earliest (ARB) implementation of VBOs.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: how to draw a matrix of color values?

rtayek
At 06:20 AM 8/30/2012, you wrote:
>rtayek wrote
>i have 8 1024x1024 matrices of 6-bit intensity values. ... planning
>on using dynamic draw.
>
>Dynamic VBOs fit into your needs. However, such an hint is ignored
>on the earliest (ARB) implementation of VBOs.

i have a fairly new mobo
(http://www.intel.com/content/www/us/en/motherboards/desktop-motherboards/desktop-board-dh67gd.html),
the i3 (http://ark.intel.com/products/53422/) has on-chip graphics,
so i may not have all the latest stuff.

iirc, there was a program that told me i had opengl 3/3bc (or
something like that) and another program that had none of it's check
boxes checked.

i will probably get a real graphics card soon.

thanks


---
co-chair http://ocjug.org/