Posts

Showing posts from December 14, 2018

Hackathon: Creating Three.js Objects

Image
Mar showed us the basics of three.js and how to code simple 3D objects to move on the screen. We referenced two online scripts which included the three.js library and an orbit controls script. CSS was added so that a canvas could be defined with no margin. We then created four variables: 'scene' created a new 3D scene. 'camera' created a new perspective camera which renders a similar view to what the human eye can see and is therefore the most common camera used to render 3D objects.  The way that the camera variable is constructed is to define the camera's viewing Frustum. PerspectiveCamera( vertical field of view, aspect ratio, near plane, far plane ) (Analytical Graphics inc, 2018) 'control' created the orbit controls that is assigned to the variable camera as these controls will control the camera, meaning that when the user is using these controls the shapes would appear to move because the camera has been moved. 'rendered...