1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
klemol [59]
4 years ago
7

g Suppose the vertex data is stored in an array named verts and each vertex uses a list to store the coordinates. Write the code

that will allocate a buffer in the GPU and store the data into that buffer. Use gl as the WebGL graphics object.
Computers and Technology
1 answer:
kodGreya [7K]4 years ago
3 0

Answer:

function createAndFillBufferObject(gl, data) {

 var buffer_id;

 // Create a buffer object

 buffer_id = gl.createBuffer();

 if (!buffer_id) {

   out.displayError('Failed to create the buffer object for ' + model_name);

   return null;

 }

 // Make the buffer object the active buffer.

 gl.bindBuffer(gl.ARRAY_BUFFER, buffer_id);

 // Upload the data for this buffer object to the GPU.

 gl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW);

 return buffer_id;

}

You might be interested in
Two electronics students are discussing static electricity and electric current. Student A says that a basic property of static
Svet_ta [14]
The answer is D. Only student B is correct. Student A is incorrect because static electricity can be detected through the principle of electrostatic induction, which will indicate if there are static electricity on the surface of an object. A device which can detect static electricity is an electroscope. Moreover, for student B, it is correct that the cause for electric current to flow is the uniform flow of free electrons.
3 0
3 years ago
Which is a challenge in photographing forests
Murljashka [212]
Getting the right angle, making sure their is detail in the image

8 0
4 years ago
Read 2 more answers
Do u know the way!!!!!!!
Ratling [72]
Yes brudda! to the queen!!
3 0
3 years ago
Read 2 more answers
Remember not to use tools that are ________ in any way.
kupik [55]
Remember not to use tools that are rusty and damaged in any way.
3 0
3 years ago
What law is someone punished for accessing a computer without permission?
podryga [215]
It depends the case. This is usually a computer crime. Many times depends on the state and that law that they have. It varies for punishment depending on how severely the crime was; meaning that there could potentially be jail time.
3 0
3 years ago
Other questions:
  • Nathan notices his computer System is slowing down when he tries to copy documents to it he also gets a prompt I warned him that
    7·1 answer
  • 1. Why was the Internet created?
    8·1 answer
  • What method of the Math object can be used to return the largest value from the values that are passed to it?
    14·1 answer
  • The scope of a variable declared inside of a function is:
    8·1 answer
  • Which of the following could you use to submit work from home?
    15·1 answer
  • What is the name of the the world cell of the internet?​
    8·1 answer
  • You are designing an ecommerce web application that will scale to hundreds of thousands of concurrent users. Which database tech
    10·1 answer
  • What does error code 18 indicate?
    11·1 answer
  • A brief contains an initial definition statement of the design aim and defines any constraints?
    11·1 answer
  • Select the correct answer.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!