Make entities color alpha non additive

Hi there.
This is a simple question.
I am trying to create some kind of “history of entity” which could be interpreted as “last entity positions”.
I am currently trying to simply create the entities each one in it’s corresponding location but the problem is that I want to use an Alpha to make the history different from the current position (with no alpha) and the alpha of the history entities is being combined.

Is there a way to make the alpha non additive?

In case not, How could I combine multiple entities to create a new shape so then I can use an alpha for that new entity?

Here is a Sandcastle to show what i mean.

Hi,
I’m not sure if this can be helpful to you or not. But you can try parent property of an entity. Here is the sandcastle example.

  • Regards

Even though I thought that would be the solution, it is the same outcome (in case i am doing it properly).

The alphas still add each other:
Demo with those changes

Are you trying to achieve something like this? I’ve just matched polygon hierarchy with the previous polygon.

The thing is that I want the program to be rendering entities all the time, with the history “behind” it, like a footprint with some history.

I have in mind 2 possible solutions.

  • Combining all entities which form the history footprint and make them all (together) to have a 0.3 alpha like this:
    image
    Keep in mind this combination is just the polygon in the last 3 states combined. (I say 3 states but this could be different, just as an example).
  • Not combining the entities which form the history footprint and make them overlap but somehow preventing 2 overlaping entities to combine their color alphas.
    I do not want this:
    image

Your suggestion could work too but I do not know how I could combine the hierarchies in an easy way. If you know how to combine 3 hierarchies like what you did or in a total one it could work too.

I’ve tried to create a simple function to generate joined hierarchies. You can check this link and modify it as per your need.

1 Like

That is exactly what I wanted to achieve. You cant imagine how much that helps.

I will try it on monday at work but it looks exactly what I wanted. Thank you very much, really.

Unfortunately, I can not implement that solution but that made me think about it in a different way. I think I can create myself a function to achieve that.

The problem I have with that is that my polygons in different times can be different both in shape and position. It is not the same polygon and it can even non exist.

I’ll try to adapt your function and apply it to my code and see if I can make it.

It is sad, because just applying a global alpha color would have been enough.

This is a more realistic example. Notice that “history2Ago” has no hierarchy cause this could happen in my scenario.

I tried to achieve this using primitives but the result is the same because the alphas are still overlapped :frowning:

Update: I finally got a decent solution: Since you can specify holes in the polygon, it is possible to make holes using the other polygons hierarchy.

I’m glad to help you. Please share your final solution in sandcastle.

1 Like

I thought i had achieved it but I was wrong.

I made a simple sandcastle to show what i mean. It can be useful for someone who wants polygons inside of each other:

The problem is that it does not work if any previous polygon is outside:

Sandcastle.