0% found this document useful (0 votes)
5 views3 pages

Basic HTML Script Overview

This document provides an overview of key concepts in HTML, JavaScript, and Three.js for creating 3D graphics on a web page. It explains basic HTML page structure with <head>, <title>, and <body> tags. It also covers JavaScript variables, data types like strings and booleans, math operations, conditional statements, arrays, and functions. The document demonstrates how to incorporate Three.js for 3D objects and animations with rotation values, dates, and event listeners for user input. Overall, the document outlines the core building blocks for developing interactive 3D graphics using HTML, CSS, JavaScript and Three.js.

Uploaded by

DrafteeDragon
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views3 pages

Basic HTML Script Overview

This document provides an overview of key concepts in HTML, JavaScript, and Three.js for creating 3D graphics on a web page. It explains basic HTML page structure with <head>, <title>, and <body> tags. It also covers JavaScript variables, data types like strings and booleans, math operations, conditional statements, arrays, and functions. The document demonstrates how to incorporate Three.js for 3D objects and animations with rotation values, dates, and event listeners for user input. Overall, the document outlines the core building blocks for developing interactive 3D graphics using HTML, CSS, JavaScript and Three.js.

Uploaded by

DrafteeDragon
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd

Physics and Engineering 2016

Reach Cambridge

BASIC HTML PAGE


<HTML>
<HEAD>
<TITLE>
Title Here
</TITLE>
<STYLE>
canvas {width: 100%; height: 100%}
</STYLE>
</HEAD>
<BODY>
<SCRIPT>
//Code here
</SCRIPT>
</BODY>
</HTML>

var
The var key is short for variable. A variable is a command that can
change

Math in HTML Code

[Link].x = [Link]/6;
[Link].y = [Link] ( ) * 0.0049

Booleans
true/false
var yes = true;

Strings
Caracters

var str1 = something


var str 2 = bob

str1+ + str2
//Something bob

var str = The answer to 7 + 4 is ;


var answer = 11
//7+4

Repeating and Skipping Code

[Link](keydown,function(event){var code =
event;keyCode;

1) if (code==32) pushCar(); // space


2) else if (code ==37) rotateCar(-1); //left

Listing things

var amazing_movies = [
Star Wars,
Name of movie,

Structure of the code


<html>
<head>
<title>
Title for my program
</title>
<style>
canvas { width: 100%; height: 100% }
</style>
</head>
<body>
<script
src="//[Link]/ajax/libs/[Link]/r50/[Link]">
</script>
<script>

</script>
</body>
</html>

You might also like