how to make a slated cube like minecraft water side
Well first hello and welcome!!
Just FYI, Minecraft is actually using babylonjs
https://classic.minecraft.net/
From this very forum:
its nice good luck
@Amine_Assine ⌠did you have question?
Are you ASKING how to make water slide voxel?
I see no question marks in your post or title, but you ARE talking in âQuestionsâ forum.
It seems⌠each âwater voxelâ needs to analyze what type of non-water voxel⌠is on ALL sides and UNDER where water should be placed.
It seems⌠to properly âshapeâ a water voxel, the program must study the âenvironmentâ AFTER the mouse click.
Sometimes the water must be a STEEP angle, and sometimes a shallow angle. Sometimes water must turn FULL corner, sometimes HALF corner, sometimes go straight.
(Although not invented yet, sometimes the water must âgo-aroundâ a rock/stump/pole in river.)
So, it seems that building/placing a water voxel⌠is a âdynamicâ (smart/AI) operation. After the click-to-place, the âunder-structuresâ (steepness and run-distance) and âside-structuresâ (straight, turns, width, etc) of the neighboring NON-water⌠must be carefully measured.
After the âsub-structuresâ of the water-slide âstepâ is precisely studied by the computer/program⌠THEN the proper water shape can be created by the computer/program⌠and placed atop/within the containment sub-structure.
What I mean by âcontainment sub-structureâ is⌠the âbanksâ and âriver bedâ that the water is to travel-thru or travel-across. The computer/program must know the shape (drop-angles & turn-angles) of the âriver bedâ or water-slide âframeâ⌠and THEN it can properly build the correct water shape for THAT portion.
It seems like this activity would be a challenging programming task. In real life, the water follows the precise shape and contours of the water container. This is how the water sets its geometric shape.
Yes, the water mesh shape can be (and is) done with mesh vertices, but only done AFTER the waterâs container is precisely measured and well known.
https://www.google.com/search?q=minecraft+water+slide&source=lnms&tbm=isch
See, some slides are steep, some non-steep, sometimes curved, sometimes straight, sometimes narrow, sometimes wide, sometimes water is deep, sometimes shallow, sometimes even a waterfall.
Each âstepâ of the water slide or river⌠is âcustom madeâ AFTER testing the shape/style of the waterâs container/slide-frame/riverbed.
You will need to be a good programmer, I think. There seems to me no easy/simple way.
Water is a âcoatingâ over blocks, and blocks can be MANY/ANY shape(s), so the water must ALSO be many/any shape(s). In a way of speaking, the water shape must be âsmartâ. It must carefully study its container, and then create itself exactly correct for the container.
Babylon âraysâ might be able to â3d-scanâ the shape/contour(s) of the container where the water will be placed. First the click, then the program scans (shoots/casts many rays), then program gathers all info from the ray-casts, and THEN⌠the program knows how to shape/place the water. Complex work, perhaps.
It might be wise to carefully web-study âray castingâ and its MANY uses for computing.
These things are my opinions and guesses. I am not sure if you wanted my opinion, but I say it. I am not an expert.
Iâm not sure if you are asking a question, or perhaps trying to teach us/others how to do it. I THINK you are asking how to do it, though. I think a simple answer is⌠IT IS VERY DIFFICULT, but certainly quite possible. Stay tuned⌠perhaps more comments will come soon.
Probably the simplest way is with extrude polygon, eg Babylon.js Playground
closes thing i found but i can get it to slant down like minecraft water
https://playground.babylonjs.com/#3CZLNK#5
I think i figured it out
https://playground.babylonjs.com/#3CZLNK#6
did it ok how do remove the bottom part lol
https://playground.babylonjs.com/#3CZLNK#7
Hi again, AA.
You donât NEED TO start with a box. You can do plotting⌠from/onto a âblank meshâ:
https://www.babylonjs-playground.com/#1UHFAP#266
The entire #1UHFAP âseriesâ of playgrounds (all 266 of them) are mostly examples of free-plotting.
Hereâs another in that series. https://www.babylonjs-playground.com/#1UHFAP#60
Build any shape. No need to start-with a (standard) BJS 24-vertex box. Many of these examples⌠are 8-vertex⌠perhaps better performance and easier to plot-with and play-with. You may want to learn the difference between âflat shadedâ and âsmooth shadedâ rendering.
I think âflat shadedâ requires more vertices, and that is why default BJS boxes are 24 vertices. I am no expert. Three vertices at each corner of box⌠means there can/will be 3 lighting-normals at each corner, too. Three (3) lighting-normals at each corner⌠is required⌠in order to make the three box-sides that intersect at the corner⌠different colors (differently shaded). Having all three sides of the box that intersect at a corner⌠each be different colors/shades⌠is what causes the âflat shaded lookâ.
Badly explained⌠sorry. Only one lighting-normal is allowed per vertex point, so we place 3 vertex at same corner-place⌠so we can have 3 lighting-normals there, and then we can accomplish flat-shaded. Without having 3 vertices at the box corner, flat-shading is impossible, and only smooth-shading is possible. (some examples here)
Look at the edge between point #1 and #2⌠here. See how it is difficult to âseeâ that edge? It is because it is smooth-shaded-rendered. If it were flat-shaded-rendered, the color on each side of that edge⌠would be somewhat different⌠and our eyes could see/clarify the edge⌠better.
Anyway, these are good playgrounds to experiment-with 3D plotting. Yours is fun/good, too. You made wise-use of GUI 2d vertex labels⌠nice job! I used a different method⌠with the âboxifyâ function. GUI 2d had not yet been invented/programmed when I created boxify() long ago. Have fun!