0

Why is everyone freaking out over JavaScript?

Mmm what does the "2d" mean whilst drawing a rectangle?

3rd May 2017, 5:49 AM
Brian Montellano
Brian Montellano - avatar
3 ответов
+ 3
While drawing a rectangle in (or even circles, text, lines, etc) you ought to choose what you want to do with the canvas (area where you will have to draw the shape). By defining the drawing context as '2d', you are simply telling the js that you want to draw a 2-dimensional shape on the canvas surface. mind you, the other alternative would be '3d' meaning 3-dimensional drawing on the canvas surface.
3rd May 2017, 7:26 AM
Dennis Chirata
Dennis Chirata - avatar
0
Thank you Dennis, that's what i thought. now, do you know how to write the code for, let's say a 3d box?
3rd May 2017, 2:02 PM
Brian Montellano
Brian Montellano - avatar
0
@Brian Montellano There is a 3D context for canvas but it is not defined as ("3d") - it is WebGL and is defined as ("webgl").
26th Dec 2017, 10:12 AM
Dennis Chirata
Dennis Chirata - avatar