Some news of the sand brush

Hi all!

It's been a long time since my last post. Lots of things happened since then: I got sick, start a chapter in my university project, finished my short experience as teacher, saw family and friends... and kept working on the sand brush (just forgot to blog about it :P).

The project changed a few things for the sake of simplicity. Since the brush have some similar aspects with games, I'll use the Qt4 Graphics Framework in Krita. Since collision detection, shape modification and object (particle) transformations will be features that the brush has to have, instead of reinventing the wheel, I saw that the Graphics Framework already have these functions.

I did some tutorials about the QGraphicsView to better understand how the QGraphicsItem, QGraphicsScene and QGraphicsView interact and how I can modify Krita's nodes and layers to work with it. I modified my previous Particle class to work in a more simple way and now I'm putting some inheritance from QGraphicsItem to proper use the Graphics Framework advantages. For instance, the updated() method of the class will work using the RK4 integration algorithm to redraw the particle new position in a animation step.

Meanwhile, I created a new paintop plugin on Krita repository and did some hacking on it so we can have some visual stuff to look at it:

I have just loaded and put some filled circles on the canvas with a (slow) depletion. When working with the brush, imagine that you have limited sand on your hand, so every stroke has a sand limit. I'm searching a better assymptotic function than the one I'm using now to do a more smooth depletion. One of the next features to do it's a more dynamic way of spreading these circles, based on the mouse movement properties (velocity, position and acceleration).

I'm studying the layers and nodes of Krita archtecture in a way that I can add a more interactive canvas to manage these circle grains. Perhaps managing these grains in this architecture will yield a behaviour closer to the expected.

Till next time!

5 comentários:

  1. @prokoudine: We refer to layers and masks as nodes internally. But we don't have a node UI like Blender.

  2. Anônimo12:05 PM

    Chicáo, maybe you should take a look at the CGAL library, very robust for computer algebra algorythms.

  3. @slangkamp

    Well, I _was_ referring to the internal representation :) Thanks :)

  4. BTW, will the paint op try to simulate the way sand tends to spread unevenly when poured from a palm?