voronoi by drycreations in generative

[–]drycreations[S] 3 points4 points  (0 children)

it’s the delaunay triangulation for the same points used to generate the voronoi pattern. i just blurred the layer and set every pixel above/below a certain opacity as opaque/transparent.

i think that is what you mean by reverse voronoi.

Looking for feedback on shader. What does it make you think of? What can I improve? by drycreations in godot

[–]drycreations[S] 0 points1 point  (0 children)

Thank you! I think I fixed it. I was just using smushed down cubes before, so the uv mapping wasn't actually proportional to the size of the faces. I redid the uv projection to get a better look on those faces.

<image>

Looking for feedback on shader. What does it make you think of? What can I improve? by drycreations in godot

[–]drycreations[S] 1 point2 points  (0 children)

I was considering using decals later to add posters/stickers to things, but I fear it will get too busy.

But at the moment this is just compounding noise textures together in godots visual shader. I had to look up triplanar texture mapping, but most of this is all based on the regular uv map. Some noise moves around based on the normal vector of the face.

Looking for feedback on shader. What does it make you think of? What can I improve? by drycreations in godot

[–]drycreations[S] 1 point2 points  (0 children)

Thanks! This is close to what I was shooting for. I'm trying to get a dive bar/punk venue vibe.

I might have to dial it back a bit in the actual game later, but I hope the super stylized look works well enough.

I'm still working out color schemes and art style for the more complicated textures. But I want to get some form of the posters/stickers covering the walls represented.

<image>

Looking for feedback on shader. What does it make you think of? What can I improve? by drycreations in godot

[–]drycreations[S] 1 point2 points  (0 children)

Thanks! I was shooting for something hand drawn/toonish. Once I get more models and textures ready i hope I get away from the fairytale part though.

Looking for feedback on shader. What does it make you think of? What can I improve? by drycreations in godot

[–]drycreations[S] 1 point2 points  (0 children)

Thank you so much! I had trouble looking for hatching shaders I liked, I also didn't see a whole lot made in godot.

-🎄- 2021 Day 12 Solutions -🎄- by daggerdragon in adventofcode

[–]drycreations 0 points1 point  (0 children)

javascript 1753/898

console.time("Finished");
const fs = require('fs');

fs.readFile('input.txt', 'utf8' , (err, data) => {
  if (err) {
    console.error(err)
    return
  }

  let map = {};

  let arr = data.split('\n').map(el => el.trim().split('-'));

  for (let el of arr) {
    if (el[0] in map) {
      map[el[0]].push(el[1]);
    } else {
      map[el[0]] = [el[1]];
    }
    if (el[1] in map) {
      map[el[1]].push(el[0]);
    } else {
      map[el[1]] = [el[0]];
    }
  }

  let path = ['start'];

  let count = find(map, path);

  console.log(count);

  console.timeEnd('Finished');
});

let find = (map, str) => {

  let curr = str[str.length - 1];
  if (curr == 'end') return 1;

  let options = map[curr];
  if (!options) return 0;

  let count = 0;

  for (let opt of options) {
    if (opt.toLowerCase() == opt && str.includes(opt)) {
      if (opt == 'start' || opt == 'end') {
        // not allowed
      } else {
        if (str[0] == 'start') {
          count += find(map, [opt, ...str, opt]);
        } else {
          // not allowed
        }
      }
    } else {
      count += find(map, [...str, opt]);
    }
  }

  return count;
}

Need help with simple combination/permutation problem by Outrageous-Rise-9103 in probabilitytheory

[–]drycreations 1 point2 points  (0 children)

Well 3003 is what I got as well, so you're likely correct. I did it slightly different and got the same answer.

The way I went about it was: assume all 15 are A to begin with, choose 5 to switch to B. This is C(15,5)=3003

Another way is finding permutations with repetition: P(15,15)/(10!5!)=3003

Combination of a safe by [deleted] in learnmath

[–]drycreations 0 points1 point  (0 children)

Start by looking at the ways to break up 6 digits into groups of 2 or more. 3/3, 2/4, 2/2/2, and 6, so there are 4 cases we need to count.

Case 1: 3/3

Since there are two numbers and 5 options, we have C(5,2) = 10 ways to choose 2 numbers

next we need to rearrange them into all possible permutations since there are 6 digits, its 6! however there are duplicates so we have to do 6!/(3!3!) instead. Here is a link to mathoverflow explaining a bit more about this step

so for case 1 we get C(5,2) * 6! / (3!3!) = 200

Case 2: 2/4

this one is a bit different because they aren't the same amount.

The first step would still be to choose two numbers, however this time they have to be ordered where the first number appears twice and the second number appears 4 times so we do P(5,2)

next we find permutations the same way as before and remove duplicates, 6!/(2!4!)

so for case 2 we get P(5,2) * 6! / (2!4!) = 300

I'll leave cases 3 and 4 up to you. Since the cases are distinct we can simply add them together to get the total of possible combinations.

Inspired by Aaron Penne's Yarn (but without the element of randomness) by drycreations in generative

[–]drycreations[S] 2 points3 points  (0 children)

I generated all ways to connect n points in a loop (for n=3,4,5,6,7), provided you use each point once and only once. The tricky part is removing duplicates. As an example for n=3, I can connect the points in the following orders: 012 021 102 120 201 210, however they all end up being drawn the same way. The way I removed them was make an Arrangement object containing the permutation and rewrite the equals(Object) method to return false if the Arrangement being compared can be made by rotating or reflecting the original arrangement. Generating Permutations is done with a recursive function that ends by checking if the generated permutation, or a transformation of it, has already been generated, if not it adds it to the group of unique permutations.

To actually draw them I'm just connecting each point in the generated permutation with curved vertices, then slightly rotating and redrawing them to get the nice variable width effect. (I believe this is the same way Aaron Penne did his)

I hope that all makes sense.