Endless sketchfab in Babylon.js

Imagine sketchfab with an infinite number of different models! I made a program that would generate all kinds of OBJ models, all kinds of placement of combinations of dots and meshes.

c333b43bfeda49ba0e11c0121935e546fa3bf7e6

Now I have added a second version of the application where we could see any OBJ models with any number of vertices, and meshes from 1 to infinity. of the program where there is a level input field in which we can enter the number 1 to infinity, which will be proportional to the number of vertices and meshes.

This is a continuation of my theme on blenderartists

The probability that a gun-like structure will be generated is a difficult problem because it depends on many factors such as the number of vertices, the number of faces, the range of coordinates, etc.

However, we can try to estimate this probability using some approximate methods.

One way to assess this probability is to use the concept of “complexity” of the structure. The complexity of a structure can be defined as the number of different elements that make up it, such as vertices, faces, edges, etc.

A pistol is a relatively complex structure consisting of many elements, such as a barrel, handle, trigger, etc. Therefore, the probability that a structure resembling a pistol will be generated will be low if the number of vertices and faces is small.

Let’s look at the following assessment:

  1. The probability that a structure consisting of 10 vertices and 10 faces will be generated is approximately 10^(-10), since each vertex and each face have 10 possible locations.
  2. The probability that a structure consisting of 100 vertices and 100 faces will be generated is approximately 10^(-100), since each vertex and each face have 100 possible locations.

As you can see, the probability that a structure resembling a gun will be generated decreases rapidly with an increase in the number of vertices and faces.

However, this is only a rough estimate, and the real probability that a structure resembling a gun will be generated can be much higher if we take into account some features of generating random structures, such as symmetry, repetition, etc.

In general, the probability that a gun-like structure will be generated is very low, but not zero. This means that, although it is very unlikely, it is still possible that a gun-like structure will be generated if we generate a sufficiently large number of random structures.

=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/

In order to present the full scale, I made an online version ~> Endless sketchfab on Babylon.js (Version 0) | Babylon.js Playground.

Of course, you should not manually check the random connection of vertices and faces and click “try again” 125,386,365 times until you get an acceptable result… Let’s do an orderly generation instead of a chaotic one, where at least we’ll understand the logic… Here is the second online version of the infinite sketchfab ~> Endless sketchfab on Babylon.js (Version 1 - Ordered generation) | Babylon.js Playground.

Great, but now I need to add the ability to teleport so that I don’t have to fly for a billion years to the desired OBJ model… Let’s add such a possibility, here is the third version of the program where there is such an opportunity ~> Endless sketchfab on Babylon.js (Version 2 - With the ability to teleport) | Babylon.js Playground

But we do not take into account that there should be all possible OBJ models with all possible number of vertices and faces, that is, the chunk number should be proportional to the number of vertices and faces in the OBJ model! They must be so that OBJ models are not generated in height, but only along the X-coordinate axis, which is proportional to the placement and combination of vertices and faces without repetition on all possible coordinates, and also along the Z-axis coordinate, which is proportional to the increase of these vertices and faces! ~>
Endless sketchfab on Babylon.js (Version 3 - Serpentine paths) | Babylon.js Playground

A local version with input fields where the first field is the total number of vertices and faces, and the second field is the model number in this endless sketchfab library

Endless sketchfab on Babylon.js (Version 4 - Local version with input fields for the model) | Babylon.js Playground

A local version with the auto-switch button.

Endless sketchfab on Babylon.js (Version 5 - With the auto-switch button) | Babylon.js Playground

But I need to make it possible to enter float numbers, which is very fast to move auto-switch to random OBJ models, and I also fixed the number of vertices and faces in proportion to the input fields.

Endless sketchfab on Babylon.js (Version 6 - With the auto-switch button FIXED version) | Babylon.js Playground

All that remains is to add fields for random switching ranges for the faces and points fields so that you can switch between the minimum and maximum faces and points ranges separately from the randomly selected one.

Endless sketchfab on Babylon.js (Version 7 - With an automatic switch button, and fields for the range of random switch) | Babylon.js Playground

I added the download model button, and solved all the other problems now it’s a FULL version.

Endless sketchfab on Babylon.js (Version 8 - FULL version) | Babylon.js Playground

3 Likes

Hello @MakarovDs777 !

Funny project ! Unfortunately, while explorating some pure noise, the odds of seeing by chance the 3D modeling of an actual object is quite low :joy:


Do you know about GANs ? If not, you should definively have a look !
GAN (Generative Advertial Networks) are the heart behind what became later the Stable Diffusion AIs used by Midjourney, ChatGPT, Grok, to generate images…

  • One “Generator” starts from noise and generate images
  • One “Discrimator” which is trained on real images says how much it’s “noise”.
  • The first one edit the noise so that the second one sees a less “noisy” image
  • Eventually, the two “advertial” network converge toward something
  • Changing the very first input noise change totally the final converged destination

If you know about Python, you should definively give it a try ! (tensorflow, keras)
Back in 2014 when I started this it was a nightmare, no library existed, papers was partially published, etc… Now that we are in the world of OpenSource + AIs … You can go fast :slight_smile:

@Tricotou It looks like I’m going to have to learn neural networks anyway! I have only 1 step left to take to fully implement backrooms - to create an endless procedural generation of all kinds of objects without repetitions, and place these very objects in all kinds of variations in all kinds of rooms, and all kinds of corridors without repetitions! But I would like to get around without neural networks somehow, maybe there are some other ideas on how to implement this besides neural networks?

You can give a try to the grand father of Neural Networks : SVM :slight_smile:
But keep in mind using SVMs will limit you because of lack of creativity, don’t expect to use SVM to create a lot of “new params” for generating your meshes, but given an initial set of params, it can be handy to train to classify between good looking generations, and bad looking generations, including feature extraction, etc…


@Tricotou Of course, I’ll take a look, and maybe I’ll come up with something… But I wrote neural networks are not an option, it’s too much data, and how will you determine 1 000 000 000 + is OBJ something that is not a chaos of random sets of points and faces, but something really meaningful!? After all, let’s say you can try to train a neural network model to distinguish weapons from the random chaos of sets of dots and faces, it would be a cool scene like in the movie The Matrix with endless racks of weapons:
2025-03-28-18-47-36-765
but what to do with the rest of the models if these models are buildings, food, furniture, accessories, and so on… The question here is not about neural networks, but more about how to sort the infinity of meaningful from the infinity of meaningless, that is, in a sequence of numbers…

Added the sixth and seventh versions, see the root comments above.

I added the download model button, and solved all the other problems now it’s a FULL version.

Endless sketchfab on Babylon.js (Version 8 - FULL version) | Babylon.js Playground