The Environment
The Environment
This is a tutorial and Platform. Each web page is divided into 4 windows:
Two windows at the left.
At the top of left windows, show a list of chapters of this tutorials.
The window at the top left is to present the notes of the chapters.
The window at the bottom left presents the details of each chapters.
Double click on each one of two windows, make the window larger.
The two windows at the right introduce a platform to a WebGL.
The bottom window at the right is to writes codes. It is labelled “Edit Code
Window”
The first tab is a text area to write the source code WebGL application
using JavaScript.
The second tab is a text area to write the code source for vertex shader
using GL Shader Language (GLSL).
The third tab is a text area to write the code source for fragment shader
using GLSL.
Tutorial and Platform
2
When the chapter is chosen notes and detailed of the chapter are
displayed and all the code sources related to the chapter are written on
the appropriate text area just click on the tabs.
Just click on run code button and the code is executed. Projection screen
and objects will be displayed on the top of the right side window labelled
“Visualization” window.
You could modify the code sources and then click run to see the
modifications displayed on “Visualization” window.
Reset button return back the code source to its origin.
The edit code window and visualization window are actually a platform to
test WebGL code using the following highlights:
The canvas id is: "codeRunning-canvas“
You need to provide code shaders to the WebGL program. There
many ways to provide vertex and fragment shaders. I did them this
way:
var VSTextarea = document.getElementById("vsCode");
var FSTextarea = document.getElementById("fsCode");
vsSource = eval( VSTextarea.value ) ;
fsSource = eval( FSTextarea.value ) ;
Introduction
Computer Graphics with GL