gama.old icon indicating copy to clipboard operation
gama.old copied to clipboard

gradient fill a shape

Open sriramab opened this issue 8 years ago • 6 comments

I would like to request an enhancement to be able to fill a shape with gradient colour. Something like fill_gradient() perhaps?

I see some possible syntax formats here https://developer.mozilla.org/en-US/docs/Web/CSS/linear-gradient

and some examples here https://docs.oracle.com/javase/7/docs/api/java/awt/LinearGradientPaint.html

thanks

sriramab avatar Feb 23 '17 14:02 sriramab

Yep -- not too complex to implement in Java2D (Oracle's doc), but a pain in OpenGL as far as I can see what it would mobilise (either painting to a dynamic texture or weighing the vertices depending on the gradient stop points...). Actually, simple gradients on simple shapes should be easy to produce (triangles, quadrilaterals), but the main problem would be to render them on complex shapes...

AlexisDrogoul avatar Feb 23 '17 15:02 AlexisDrogoul

Hmm, I am more than happy to have this in just the basic shapes. It is for visualising agent's property, such as energy levels in predator-prey models or happiness index in segregation models. Or do you have some other temporary solution?

sriramab avatar Feb 23 '17 15:02 sriramab

I mean depleting or replenishing energy or happiness levels, this variable goes into the linear gradient percentage.

sriramab avatar Feb 23 '17 15:02 sriramab

With the "shader" pipeline of opengl, gradiant colors are super easy to implement. But I don't know in which stage is this work... On Feb 24, 2017 4:35 AM, "Srirāma Bhamidipāti" [email protected] wrote:

I mean depleting or replenishing energy or happiness levels, this variable goes into the linear gradient percentage.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/gama-platform/gama/issues/2119#issuecomment-282025847, or mute the thread https://github.com/notifications/unsubscribe-auth/AMYF42GPmKH9bq5iKyZZDk6qFXvtiGwaks5rfadAgaJpZM4MKDvx .

mazarsju avatar Feb 24 '17 05:02 mazarsju

Now tracked in #2728

AlexisDrogoul avatar May 19 '19 16:05 AlexisDrogoul

Reopening this issue for the next round of development on GAMA 2.0

AlexisDrogoul avatar Feb 20 '22 03:02 AlexisDrogoul