Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fall Banner 2023 Idea - Dev Diary
#5
So for a compound shape (like boolean operation Add, Subtract, etc.)

Operation will be destructive (compound shape is composited on new image)
We will freeimage away our source shapes that compose the compound shape

What defines a compound shape?
The shapes are all the same colors
They do not have to touch each other

For a boolean operation of Add:
Compound shape members which overlap other compound shape members and draw on top of each other are kept and merged together.

For a boolean operation of Subtract:
Compound shape members which overlap other compound shape members are cut out.
In vector drawing programs there are typically operations like "Minus Front" and "Minus Back".
We will have only Minus, and it will always be minus front. That is, our boolean operation will only take 2 shapes, and the last shape passed in will be the front-most.

So therefore a mouth could be composed like so:

  1. Shape: Ellipse
  2. Shape: Rectangle
  3. Position Rectangle half over ellipse
  4. Subtract Rectangle from Ellipse
  5. New shape is a half circle
  6. This is "mouth" shape

Now for the teeth:
  1. Use "mouth" shape as base
  2. Set shape area to rect for mouth shape
  3. Randomize rectangles on top
  4. Add rectangle to Mouth shape
  5. continue for n teeth

This is another edge case - we will also want some kind of shape area to define "undrawable" areas.

For example, in a mouth the teeth shouldn't overlap, but be separate. So once we draw the teeth we should change the bounding rectangle or shape area to prevent a random tooth being drawn on another one.

The idea is that we will use separate image handles for each of our building blocks, and approximate a vector approach.

We won't support transparency for now, because that's going to be a bit much. But, since cutting just means making something a background color, and superimposing it on top of something else that shares that background color, it will appear as transparent in the master compositing of the final image.

Then, using the same shape areas, and shape stuff we outlined previously, and creation of a compound shape with destructive booleans, we can assemble and randomize what we need.

A final thought - since we're using image handles, we do not want to closely-couple our shape and boolean and compound/composite stuff to our shape area stuff - we want loose binding between these because we can use the same logic/functions for images that aren't single colors or faking to be vectors. There is no reason we couldn't use the add or subtract to cut or add full images to each other. Since we're just defining images, positions, and destinations in a layout of rectangles..
grymmjack (gj!)
GitHubYouTube | Soundcloud | 16colo.rs
Reply


Messages In This Thread
Fall Banner 2023 Idea - Dev Diary - by grymmjack - 09-02-2023, 12:59 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 01:11 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 01:17 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 01:45 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 02:01 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 02:07 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 02:33 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 02:40 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 02:49 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 03:18 AM
RE: Fall Banner 2023 Idea - by grymmjack - 09-02-2023, 03:29 AM
RE: Fall Banner 2023 Idea - Dev Diary - by dbox - 09-02-2023, 03:37 AM
RE: Fall Banner 2023 Idea - Dev Diary - by dbox - 09-02-2023, 02:02 PM
RE: Fall Banner 2023 Idea - Dev Diary - by bplus - 09-02-2023, 03:29 PM
RE: Fall Banner 2023 Idea - Dev Diary - by bplus - 09-06-2023, 01:59 PM



Users browsing this thread: 1 Guest(s)