Question

LoadMesh.py also needs a small modification, thus: class LoadMesh(Mesh3D): def __init__(self, vao_ref, material, draw_type, model_filename, texture_file=””, back_face_cull=False): .. #Comment out v_uvs as they aren’t needed for #the shader and will cause Windows errors #v_uvs = GraphicsData(“vec2”, self.uv_vals) #v_uvs.create_variable( # self.material.program_id, # “vertex_uv”) self.albedo = None self.metallic = None self.roughness = None self.ao = None #Comment out these next lines or remove them. #if texture_file is not None: #self.image = Texture(texture_file) #self.texture = Uniform(“sampler2D”, #[self.image.texture_id, # 1]) def format_vertices(self, coordinates, triangles): .. def set_properties(self, albedo, metallic, roughness, ao): self.albedo = Uniform(“vec3”, albedo) self.metallic = Uniform(“float”, metallic) self.roughness = Uniform(“float”, roughness) self.ao = Uniform(“float”, ao) def draw(self): self.albedo.find_variable( self.material.program_id, “albedo”) self.albedo.load() self.metallic.find_variable( self.material.program_id, “metallic”) self.metallic.load() self.roughness.find_variable( self.material.program_id, “roughness”) self.roughness.load() self.ao.find_variable( self.material.program_id, “ao”) self.ao.load() glBindVertexArray(self.vao_ref) glDrawArrays(self.draw_type, 0, len(self.coordinates)) ..

   LoadMesh.py also needs a small modification, thus:
class LoadMesh(Mesh3D):
def __init__(self, vao_ref, material, draw_type,
model_filename, texture_file=””,
back_face_cull=False):
..
#Comment out v_uvs as they aren’t needed for
#the shader and will cause Windows errors
#v_uvs = GraphicsData(“vec2”, self.uv_vals)
#v_uvs.create_variable(
# self.material.program_id,
# “vertex_uv”)
self.albedo = None
self.metallic = None
self.roughness = None
self.ao = None
#Comment out these next lines or remove them.
#if texture_file is not None:
#self.image = Texture(texture_file)
#self.texture = Uniform(“sampler2D”,
#[self.image.texture_id,
# 1])
def format_vertices(self, coordinates, triangles):
..
def set_properties(self, albedo, metallic,
roughness, ao):
self.albedo = Uniform(“vec3”, albedo)
self.metallic = Uniform(“float”, metallic)
self.roughness = Uniform(“float”, roughness)
self.ao = Uniform(“float”, ao)
def draw(self):
self.albedo.find_variable(
self.material.program_id,
“albedo”)
self.albedo.load()
self.metallic.find_variable(
self.material.program_id,
“metallic”)
self.metallic.load()
self.roughness.find_variable(
self.material.program_id,
“roughness”)
self.roughness.load()
self.ao.find_variable(
self.material.program_id, “ao”)
self.ao.load()
glBindVertexArray(self.vao_ref)
glDrawArrays(self.draw_type, 0,
len(self.coordinates))
..
Show more…
Mathematics for Game Programming and Computer Graphics: Explore the essential mathematics for creating, rendering, and manipulating 3D virtual environments
Mathematics for Game Programming and Computer Graphics: Explore the essential mathematics for creating, rendering, and manipulating 3D virtual environments
Penny de Byl 1st Edition
Chapter 19, Problem 6 ↓

Instant Answer

verified

Step 1

This class is defined with an `__init__` method that initializes several parameters including `vao_ref`, `material`, `draw_type`, `model_filename`, `texture_file`, and `back_face_cull`.  Show more…

Show all steps

lock
AceChat toggle button
Close icon
Ace pointing down

Please give Ace some feedback

Your feedback will help us improve your experience

Thumb up icon Thumb down icon
Thanks for your feedback!
Profile picture
LoadMesh.py also needs a small modification, thus: class LoadMesh(Mesh3D): def __init__(self, vao_ref, material, draw_type, model_filename, texture_file=””, back_face_cull=False): .. #Comment out v_uvs as they aren’t needed for #the shader and will cause Windows errors #v_uvs = GraphicsData(“vec2”, self.uv_vals) #v_uvs.create_variable( # self.material.program_id, # “vertex_uv”) self.albedo = None self.metallic = None self.roughness = None self.ao = None #Comment out these next lines or remove them. #if texture_file is not None: #self.image = Texture(texture_file) #self.texture = Uniform(“sampler2D”, #[self.image.texture_id, # 1]) def format_vertices(self, coordinates, triangles): .. def set_properties(self, albedo, metallic, roughness, ao): self.albedo = Uniform(“vec3”, albedo) self.metallic = Uniform(“float”, metallic) self.roughness = Uniform(“float”, roughness) self.ao = Uniform(“float”, ao) def draw(self): self.albedo.find_variable( self.material.program_id, “albedo”) self.albedo.load() self.metallic.find_variable( self.material.program_id, “metallic”) self.metallic.load() self.roughness.find_variable( self.material.program_id, “roughness”) self.roughness.load() self.ao.find_variable( self.material.program_id, “ao”) self.ao.load() glBindVertexArray(self.vao_ref) glDrawArrays(self.draw_type, 0, len(self.coordinates)) ..
Close icon
Play audio
Feedback
Powered by NumerAI
Need help? Use Ace
Ace is your personal tutor. It breaks down any question with clear steps so you can learn.
Start Using Ace
Ace is your personal tutor for learning
Step-by-step explanations
Instant summaries
Summarize YouTube videos
Understand textbook images or PDFs
Study tools like quizzes and flashcards
Listen to your notes as a podcast
Continue solving this problem
Create a free account to:
  • View full step-by-step solution
  • Ask follow-up questions with Ace AI
  • Save progress and study later
Continue Free
Numerade

Get step-by-step video solution
from top educators

Continue with Clever
or



By creating an account, you agree to the Terms of Service and Privacy Policy
Already have an account? Log In

A free answer
just for you

Watch the video solution with this free unlock.

Numerade

Log in to watch this video
...and 100,000,000 more!


EMAIL

PASSWORD

OR
Continue with Clever