Defining what the GUI will look like
We will define a very simple layout for our application. The title will go on top, and then we have two div
tags. The div
on the left will contain the instructions and the tools we can use on the scene. The canvas will be placed inside the div
on the right, shown as follows:
The code to achieve this layout looks like this (css/cars.css
):
#header { height: 50px; background-color: #ccc; margin-bottom: 10px; } #nav { float: left; width: 28%; height: 80%; background-color: #ccc; margin-bottom: 1px; } #content { float: right; margin-left: 1%; width: 70%; height: 80%; background-color: #ccc; margin-bottom: 1px; }
And ...
Get WebGL Beginner's Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.