Answer the question
In order to leave comments, you need to log in
How does 3d work on the site?
There is a site sonorans-valley.com , on the main page you will see a skull in 3d. I wanted to ask how it was done, is it really all drawn on the canvas?
Answer the question
In order to leave comments, you need to log in
Why not?
judging by <canvas class="title"></canvas>
this, he is born and is.
There are also pieces of code like:
var e=t.createElement("canvas");return!(!e.getContext||!e.getContext("2d"))
which seems to indicate.
Canvas has 2 contexts -- Context2D and WebGL.
If the first one is used mainly for drawing 2D (although 3D can also be drawn on it, and it’s not even too difficult, look for articles by the user haqreu on Habré), then WebGL is almost a complete analogue of OpenGL (and a huge number of games work on OpenGL and applications, but at least there was a quake on it). Accordingly, it works quickly, 3D is easy to draw.
Well, I'm not talking about a huge number of libraries for drawing 3D on it, one of the most famous is the already mentioned ThreeJS.
3d on webGl. Even when you initialize the canvas, you need to write the line getContext('2d')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question