2019-03-05

Mar 6 In-Class Exercise Thread.

Post your solutions to the March 6 In-class exercise to this thread.
Best,
Chris
Post your solutions to the March 6 In-class exercise to this thread. Best, Chris
2019-03-06

-- Mar 6 In-Class Exercise Thread
Hi,
The VRObject could have a few helper methods such as
 
init() -- set up the internal state of the VRObject
 
update(deltaTime) -- update the internal state of the VRObjects before rendering them to the screen
 
render(renderInfo) -- render the object to the screen using render info which contains the context, the model view matrix, the current program
(Edited: 2019-03-06)
Hi, The VRObject could have a few helper methods such as init() -- set up the internal state of the VRObject update(deltaTime) -- update the internal state of the VRObjects before rendering them to the screen render(renderInfo) -- render the object to the screen using render info which contains the context, the model view matrix, the current program

-- Mar 6 In-Class Exercise Thread
VRExperience
 
drawScene = (gl, program, buffers, deltaTime) => { //clears the scene, then renders the matrices & binds/enables the buffers so that objects can be drawn; each VRObject will have 1 vertex buffer, 1 color buffer, and 1 indices buffer }
 
VRObject
 
getVertexBuffer = () => { //returns vertex buffer }
 
getColorBuffer = () => { //returns color buffer }
 
getIndicesBuffer = () => { //returns indices buffer }
VRExperience drawScene = (gl, program, buffers, deltaTime) => { //clears the scene, then renders the matrices & binds/enables the buffers so that objects can be drawn; each VRObject will have 1 vertex buffer, 1 color buffer, and 1 indices buffer } VRObject getVertexBuffer = () => { //returns vertex buffer } getColorBuffer = () => { //returns color buffer } getIndicesBuffer = () => { //returns indices buffer }

-- Mar 6 In-Class Exercise Thread
A couple of useful methods for the object to have would be:
VrObject(): a constructor for a new VR Object
setVertexBuffer(Mat a ): takes in a matrix as a parameter and set it as the object's vertex buffer
setColorBuffer(Mat a)
setIndexBuffer(Mat a)
 
(Edited: 2019-03-06)
A couple of useful methods for the object to have would be: VrObject(): a constructor for a new VR Object setVertexBuffer(Mat a ): takes in a matrix as a parameter and set it as the object's vertex buffer setColorBuffer(Mat a) setIndexBuffer(Mat a)

-- Mar 6 In-Class Exercise Thread
3 methods that would be useful for VRObject to have to facilitate drawScene would be: update_position() : this would be useful to call every frame in case this object is animated. render(): drawScene can call this method every frame for all objects it keeps track of. This would mean each object is responsible for rendering itself and might be difficult to consistently maintain. init(): this will initialize the object and prepare it to be used by drawScene
3 methods that would be useful for VRObject to have to facilitate drawScene would be: update_position() : this would be useful to call every frame in case this object is animated. render(): drawScene can call this method every frame for all objects it keeps track of. This would mean each object is responsible for rendering itself and might be difficult to consistently maintain. init(): this will initialize the object and prepare it to be used by drawScene

-- Mar 6 In-Class Exercise Thread
1. initScene(gl)
Create a blank scene to be drawn on. This will include the code to clear all depth and color bits, while enabling common settings for WebGL features.
2. setPerspective(projMatrix)
Set up perspective using projMatrix in order to initialize point of view.
3. updateShape(gl, modelViewMatrix, projMatrix)
Use the matrices to update the current shape when rotating.
1. initScene(gl) Create a blank scene to be drawn on. This will include the code to clear all depth and color bits, while enabling common settings for WebGL features. 2. setPerspective(projMatrix) Set up perspective using projMatrix in order to initialize point of view. 3. updateShape(gl, modelViewMatrix, projMatrix) Use the matrices to update the current shape when rotating.

-- Mar 6 In-Class Exercise Thread
3 Methods:
drawVRObjects() //draws the VRObjects into our VRExperience shadeVRObjects() //shades the VRObjects of our VRExperience placeBuffer() //gets the vertices of the VRObjects
3 Methods: drawVRObjects() //draws the VRObjects into our VRExperience shadeVRObjects() //shades the VRObjects of our VRExperience placeBuffer() //gets the vertices of the VRObjects

-- Mar 6 In-Class Exercise Thread
1. getShapeInfo(VRObject): retrieves a data and info about the shape to be drawn such as vertex, color, and vertex count about the shape. By automatically binding to the buffers of each object and extracting the data. 2. drawIndividual(VRObject, shapeInfo): This would draw individual VRObjects based on the shape info. 3. transform(VRObject, rotation, translation): calculates the new matrix needed for the transformation. It could be a rotation, translation, or both.
(Edited: 2019-03-06)
1. getShapeInfo(VRObject): retrieves a data and info about the shape to be drawn such as vertex, color, and vertex count about the shape. By automatically binding to the buffers of each object and extracting the data. 2. drawIndividual(VRObject, shapeInfo): This would draw individual VRObjects based on the shape info. 3. transform(VRObject, rotation, translation): calculates the new matrix needed for the transformation. It could be a rotation, translation, or both.

-- Mar 6 In-Class Exercise Thread
1/getPosition: get vertex buffer of each object 2/getColor: get color of each object 3/getIndices: get indices buffer 4/render: used to render each object to the screen
1/getPosition: get vertex buffer of each object 2/getColor: get color of each object 3/getIndices: get indices buffer 4/render: used to render each object to the screen
X