Skip to content

Commit

Permalink
[Tested] add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Auc7us committed Dec 8, 2024
1 parent 0302263 commit 8dc434f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions levelBuilderGL.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//levelBuilderGL.js

import { calculateBoundingBox } from './groundMechanicsGL.js';

export const groundPolygons = [];
Expand Down
6 changes: 3 additions & 3 deletions renderGL.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
//renderGL.js

import { placeObj, drawRepeatingObj } from './levelBuilderGL.js';
import { updateFloatingPlatformPosition } from './groundMechanicsGL.js';
import { getLocations } from './utilsGL.js';

export function renderScene(gl, program1, program2, worldObjects, camera, projection, railPath, loopTime) {
// Set up WebGL state
// gl.clearColor(0.53*Math.cos(loopTime)*Math.cos(loopTime), 0.81*Math.cos(loopTime)*Math.cos(loopTime), 0.92* Math.cos(loopTime)*Math.cos(loopTime), 1.0); // Background color
gl.clearColor(0, 0, 0, 1.0); // Background color
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
gl.enable(gl.DEPTH_TEST);
Expand Down Expand Up @@ -82,7 +82,7 @@ export function renderScene(gl, program1, program2, worldObjects, camera, projec
vec3.normalize(light2.direction, [Math.sin(loopTime), -Math.cos(loopTime), Math.sin(loopTime)]);
gl.uniform3fv(locations2.uniforms.lightDirection, light2.direction);
gl.uniform3fv(locations2.uniforms.lightColor, light2.color);
// Render gun and bullet with specular effects
// Render gun and bullet with bpd effects
loopTime = loopTime*3
const objectsToRenderWithProgram2 = [
{ obj: worldObjects.gun, translation: [2120, 1770, 4550], rotation: { angle: 0, axis: [0, 1, 0] }, scale: [1, -1, 1], color: [0.83, 0.67, 0.3]},
Expand Down

0 comments on commit 8dc434f

Please sign in to comment.