I
I
Isaac Clark2011-12-26 19:01:35
JavaScript
Isaac Clark, 2011-12-26 19:01:35

How to draw in WebGL?

Hello.
Tell me please.
I'm making a game on canvas, drawing with sprites.
I see that some games are already being made on webGL, questions:
- sprites are not used there, then what?
- in which editor is the graphics created?
- what restrictions should a designer put on drawing models?
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
orcy, 2011-12-26
@orcy

I am not an expert in WebGL, but since the API is based on OpenGL, then the development should be similar. Graphics can be created in any editor. textures are loaded something like this: from here: learningwebgl.com/blog/?p=507. If you apply such a texture to a rectangle, you get a sprite.
var neheTexture;
function initTexture() {
neheTexture = gl.createTexture();
neheTexture.image = new Image();
neheTexture.image.onload = function() {
handleLoadedTexture(neheTexture)
}
neheTexture.image.src = "nehe.gif";
}

E
Eddy_Em, 2011-12-26
@Eddy_Em

See examples like this one

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question