WebGL Textures & Vertices

Beginner's Guide

Page Seventy One

WebGL API bindTexture(Number, WebGLTexture)

Step 4 the WebGL method bindTexture(Number, WebGLTexture) assigns the current texture to a target. Only two options exist for targets. Use either TEXTURE_2D or TEXTURE_CUBE_MAP. The book's examples only cover TEXTURE_2D. However Seven Thunder Software's book WebGL Skybox uses TEXTURE_CUBE_MAP to generate a 3 dimensional environment. Currently only pirated versions exist on the Web, please don't download, pay for, or register for WebGL Skybox. Plans are in place to post the official free version here. Until then, see WebGL Skybox Examples online and take a look at the source code. The following listing assigns TEXTURE_2D to a GLEntity.texture property.


Listing 71: WebGL API bindTexture(Number, WebGLTexture)

WebGL Beginner's Guide Introduction WebGL Beginner's Guide
Copyright © 2015 Seven Thunder Software. All Rights Reserved.