HTML and CSS Reference
In-Depth Information
To use the buffer methods you created, you'll need to manually call this.shape() ,
this.color() , and possibly this.indices() when you create a new entity. More
on how to use these new methods when you program run.js later in this chapter. In order to
output the created buffer data, you'll need to configure gd.core.draw() next.
9.2.4. Displaying shape data on a screen
Using gd.core.draw() , you'll loop through all of the current entities in gd.core
.storage.all . For each entity, you'll use a three-step process that spans three code list-
ings, which means you need to make sure each of the next three listings continues from the
previous one or the code won't work. Note also that we're now working through the second
group of steps.
• Group 2—Working with matrices and drawing shapes
◦ Step 1: Use matrices and buffers to visually output information.
◦ Step 2: Bind and draw shapes.
◦ Step 3: Detect overlap and remove entities.
◦ Step 4: Add matrix helpers to simplify matrix interaction.
◦ Step 5: Add Vlad Vukićević's WebGL helpers for rotation.
Search WWH ::




Custom Search