N
N
Nikolay Erofeev2015-04-23 11:55:37
css
Nikolay Erofeev, 2015-04-23 11:55:37

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

4 answer(s)
A
Alexander Shpak, 2015-04-23
@shpaker

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.

K
Keyten, 2015-04-23
@Keyten

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.

N
Nikolai Antonov, 2015-05-23
@my-nickname

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 question

Ask a Question

731 491 924 answers to any question