Docsity

Lecture Slides on Graphics in JavaScript | CMSC 198N, Study notes of Computer Science

Partial preview of the text

Download Lecture Slides on Graphics in JavaScript | CMSC 198N and more Study notes Computer Science in PDF only on Docsity!

ANNOUNCEMENTS

Quiz #4 Take-home posted.

You don’t have to remove the contents of index.html you

added for project #1.

Don’t worry about the time background color (project #6).

Reference:

CSS Cookbook by Christopher Schmitt

ISBN-13: 978-0-596-52741-

http://www.oreilly.com/catalog/cssckbk2/

GRAPHICS IN JAVASCRIPT

 JS3D

 http://www.wxs.ca/js3d/

 Library which allows you to have interactive 3d objects on your

website.

 Let’s see some examples.

 Walterzorn

 http://www.walterzorn.com/jsgraphics/jsgraphics_e.htm

 JavaScript Vector Graphics Library

 Provides graphics capabilities for JavaScript: functions to draw

circles, ellipses (ovals), polygons, etc. dynamically into a webpage.

 Ortho

 http://www.craic.com/ortho/

 2-D graphics library

ROUNDING CORNERS WITH JAVASCRIPT

 Alternative I: Using Nifty Corners Cube by Alessandro

Fulciniti

 http://www.html.it/articoli/niftycube/index.html

 Alternative II: http://www.netzgesta.de/corner/

 Read license before using.

MAKING SCALABLE IMAGES

 Define width and height of images using percentages.

 Example: scalableImage.html, scalableImage.css

 Defining only the width allows you to widen the image.

 You keep the image from expanding beyond a particular

point use the max-width property.