100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
COS3712 ASSIGNMENT 2 SOLUTIONS 2021 R303,00   Add to cart

Exam (elaborations)

COS3712 ASSIGNMENT 2 SOLUTIONS 2021

 158 views  6 purchases

COS3712 ASSIGNMENT 2 SOLUTIONS 2021

Preview 3 out of 19  pages

  • May 7, 2021
  • 19
  • 2020/2021
  • Exam (elaborations)
  • Questions & answers
All documents for this subject (14)
avatar-seller
hiltontutorials
COS3712 ASSIGNMENT 2 SOLUTIONS 2021

<!DOCTYPE html>



<html>



<head>

<title>COS3712 Assignment</title>

<script type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/three.js/87/three.min.js"></script>

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/dat-
gui/0.7.2/dat.gui.min.js"></script>

<style>

body {

/* set margin to 0 and overflow to hidden, to go fullscreen */

margin: 0;

overflow: hidden;

}

</style>

</head>



<body>

<!-- Div which will hold the Output -->

<div id="WebGL-output"></div>



<!-- Javascript code that runs our Three.js examples -->

<script type="text/javascript">



// create a scene, that will hold all our elements such as objects, cameras and lights.

, var scene = new THREE.Scene();



// create a camera, which defines where we're looking at.

var camera = new THREE.PerspectiveCamera(55, window.innerWidth / window.innerHeight, 0.1,
1000);

camera.position.z = 500;



// create a render and set the size

var renderer = new THREE.WebGLRenderer();

renderer.setClearColor(new THREE.Color(0x00c9d0));

renderer.setSize(window.innerWidth, window.innerHeight);

document.body.appendChild(renderer.domElement);

renderer.shadowMapEnabled = true;



// create group

var group = new THREE.Object3D();

var globeMaterial = new THREE.MeshPhongMaterial({ color: 0xffff00, emissive: 'blue',
emissiveIntensity: 0 });

var truck_group = new THREE.Object3D();



THREE.crossOrigin = "";

//-----------------------------------create the ground-----------------------------------------------

var grass_texture = new THREE.TextureLoader().load( 'https://2.bp.blogspot.com/-
bT1mrSnNFg4/VR74ekEhgoI/AAAAAAAAHrI/0xTxxmku7Yo/s1600/Green%2Blush%2Bgrass%2Btextur
e.jpg' );

grass_texture.wrapS = THREE.RepeatWrapping;

grass_texture.wrapT = THREE.RepeatWrapping;

grass_texture.repeat.set( 8, 8 );

var planeGeometry = new THREE.PlaneGeometry(350, 300);

, var planeMaterial = new THREE.MeshLambertMaterial({ map: grass_texture});

var plane = new THREE.Mesh(planeGeometry, planeMaterial);

// rotate and position the plane

plane.rotation.x = -0.5 * Math.PI;

plane.position.x = 8.5;

plane.position.y = -12;

plane.position.z = -8;

// add the plane to the group

group.add(plane);

plane.castShadow = true;

plane.receiveShadow = true;




//---------------------------------------create truck---------------------------------------------------------

var road_group = new THREE.Object3D();

//road:

var road_texture = new THREE.TextureLoader().load( 'https://3.bp.blogspot.com/-RFCO_cQG-
mQ/UAwR3S46jlI/AAAAAAAAB4I/yvNzx2krbx4/s1600/Seamless+brick+texture+dark+00.jpg' );

road_texture.wrapS = THREE.RepeatWrapping;

road_texture.wrapT = THREE.RepeatWrapping;

road_texture.repeat.set( 10, 10 );

var road_geometry = new THREE.BoxGeometry( 350, 2, 60 );

var road_material = new THREE.MeshLambertMaterial({ map:road_texture});

var road = new THREE.Mesh( road_geometry, road_material );

road.position.y = -12.9;

road.position.x = 9;

road.position.z = 9;

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through EFT, credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying this summary from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller hiltontutorials. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy this summary for R303,00. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

60904 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy summaries for 14 years now

Start selling
R303,00  6x  sold
  • (0)
  Buy now