Advanced Graphics with the Commodore 128

Similar documents
Word Processing with Amstrad

The Commodore 64 in Action

Program and Electronic Projects for the SSC, Electron and Spectrum Computers

Computer Literacy - A Beginners' Guide

In Business Now Series Graphs and Charts Renee Huggett Markets Renee Huggett

Mastering. Spreadsheets Q

MASTERING COBOL PROGRAMMING

0 Mastering Microsoft Office

Mastering. Pascal and Delphi Programming

.,JID Macmillan Modern Office f..dst'pj lnto . 4 D I. :.sp.. w ay :e ~l. ..II Joanna Gosling l... l. MACMILLAN

MACMILAN MASTER SBUEI

Macmillan Computer Science Series

Graphics Programming in c++

COMPUTER GRAPHICS, MULTIMEDIA AND ANIMATION, Second Edition (with CD-ROM) Malay K. Pakhira

New Syllabus Mathematics for 0-Level 1

Assembly Language Assembled for the Sinclair ZX81

Fundamentals of Operating Systems. Fifth Edition

Second Edition. Concept Builders. Jana Kohout

Fundamentals of Operating Systems

An Introduction to Programming with IDL

Fundamentals of Computer Science

Mastering. C Programming 0

Computer Graphics. Apurva A. Desai

TDWI strives to provide course books that are contentrich and that serve as useful reference documents after a class has ended.

Microcomputer Applications in Structural Engineering

Foundations of 3D Graphics Programming

Student Investigations for 16-19

COURSE DELIVERY PLAN - THEORY Page 1 of 6

TIME 2014 Technology in Mathematics Education July 1 st -5 th 2014, Krems, Austria

3D Modeling in Teaching and Learning Geometry

Numerical Analysis Timothy Sauer Second Edition

SPACE - A Manifold Exploration Program

MODERN DESCRIPTIVE GEOMETRY SUPPORTED BY 3D COMPUTER MODELLING

Midterm Exam! CS 184: Foundations of Computer Graphics! page 1 of 13!

Chapter 4 Printing and Viewing a Presentation Using Proofing Tools I. Spell Check II. The Thesaurus... 23

Introduction p. 1 Java Features p. 2 Java Expansion p. 4 Getting, Setting Up, and Using Java p. 5 The Java Language p. 5 Java Swing Components p.

Lexical Priming in Spoken English Usage

1 Preview. Dr. Scott Gordon Computer Science Dept. CSUS. Virtual Cameras, Viewing Transformations: CSc-155 Advanced Computer Graphics

CHAPTER 8 Multimedia Information Retrieval

Reason with shapes and their attributes.

Excel for Chemists. Second Edition

Welcome. Microsoft PowerPoint 2010 Fundamentals Workshop. Faculty and Staff Development Program

Content Standard 1: Numbers, Number Sense, and Computation

ESSENTIAL LibreOffice Tutorials for Teachers

"Unpacking the Standards" 4th Grade Student Friendly "I Can" Statements I Can Statements I can explain why, when and how I got my answer.

Module 1: Basics of Solids Modeling with SolidWorks

Daily Warm-Ups GEOMETRY

A GEOMETRIC INTERPRETATION OF COMPLEX ZEROS OF QUADRATIC FUNCTIONS

Escher s Circle Limit Anneke Bart Saint Louis University Introduction

Table of Contents. Introduction.*.. 7. Part /: Getting Started With MATLAB 5. Chapter 1: Introducing MATLAB and Its Many Uses 7

CMSC427 Final Practice v2 Fall 2017

Some Resources. What won t I learn? What will I learn? Topics

The Foundations of Geometry

Computer Graphics: Programming, Problem Solving, and Visual Communication

CS452/552; EE465/505. Geometry Transformations

User Guide. 4th Edition, March 2005 Copyright , 2Simple Software/think ICT Ltd. PAGE

GLOBAL EDITION. Elementary Surveying. An Introduction to Geomatics FOURTEENTH EDITION. Charles D. Ghilani Paul R. Wolf

Preface A Brief History Pilot Test Results

Geometric transformations assign a point to a point, so it is a point valued function of points. Geometric transformation may destroy the equation

For more info and downloads go to: Gerrit Stols

Lecture 5: Affine Graphics A Connect the Dots Approach to Two-Dimensional Computer Graphics

Graphics and Interaction Rendering pipeline & object modelling

Chapter 5. Projections and Rendering

EXPANDING AND NETWORKING MICROCOMPUTERS

Make It with PowerPoint

Matrices. Chapter Matrix A Mathematical Definition Matrix Dimensions and Notation

A New Method for Designing Iterated Knots

Computer Graphics Disciplines. Grading. Textbooks. Course Overview. Assignment Policies. Computer Graphics Goals I

DIS: Design and imaging software

Lesson 10. Unit 3. Creating Designs. Transformational Designs. Reflection

Graphics Hardware and Display Devices

Lecture 1: Turtle Graphics. the turtle and the crane and the swallow observe the time of their coming; Jeremiah 8:7

CHAPTER 1 Graphics Systems and Models 3

TABLE OF CONTENTS. Worksheets Lesson 1 Worksheet Introduction to Geometry 41 Lesson 2 Worksheet Naming Plane and Solid Shapes.. 44

Stock Message Boards

Greencastle-Antrim School District Planned Course Board Approved: March 2010

ISBN

Excel Charts For Dummies

Oasys GSA. Getting Started

Introduction to Computer Graphics

3D Viewing Episode 2

MATH GRADE 7. Assessment Anchors & Eligible Content. Pennsylvania Department of Education 2007

Chapter 4. Chapter 4. Computer Graphics 2006/2007 Chapter 4. Introduction to 3D 1

Introduction to Matlab

VIRGINIA STANDARDS OF LEARNING. Released Test GEOMETRY Mathematics Standards of Learning. Released Spring 2014

Escher and Coxeter. A Mathematical Conversation

DA-CAD User Manual Dürkopp Adler AG

VOLUME OF A REGION CALCULATOR EBOOK

All-New Ideas! 20 Skill-Based Lessons Includes: Polygons. Space Figures. Lines, Line Segments, Rays. Angles. Similar And Congruent Figures.

The mathematics behind projections

Table of Contents. Introduction to the Math Practice Series...1

MATH GRADE 6. Assessment Anchors & Eligible Content. Pennsylvania Department of Education 2007

Game Mathematics. (12 Week Lesson Plan)

Workplace Communications The Basics George J. Searles Fifth Edition

Microsoft Office PowerPoint 2013 Courses 24 Hours

THANK YOU FOR YOUR PURCHASE!

SignGO Pro // SignGO Lite Features Listing

B.Sc. Final B.SC. PART-III PAPER I COMPUTER ORGANIZATION II

7 th Grade STAAR Crunch March 30, 2016

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Computer Graphics

Transcription:

Advanced Graphics with the Commodore 128

MacmUian Microcomputer Books General Editor: Ian Birnbaum (General Adviser (Microelectronics in Education) Education Department, Humberside County Council)) Advanced Graphics with the Acorn Electron Ian 0. Angell and Brian J. Jones Advanced Graphics with the BBC Model B Microcomputer Ian 0. Angell and Brian J. Jones Interfacing the BBC Microcomputer Brian Bannister and Michael Whitehead Assembly Language Programming for the BBC Microcomputer (second edition) Ian Birnbaum Using Your Home Computer (Practical Projects for the Micro Owner) Garth W. P. Davies The Future of the Microcomputer in Schools Nick Evans Microchild: Learning through LOGO Serafim Gascoigne The Purple Planet- Micro-PRO LOG for the Spectrum 48K Serafim Gascoigne Turtle Fun- LOGO for the Spectrum 48K Serafim Gascoigne A Science Teacher's Companion to the BBC Microcomputer Philip Hawthorne Operating the BBC Microcomputer: A Concise Guide Graham Leah Sorting Routines for Microcomputers Keith McLuckie and Angus Barber Using Sound and Speech on the BBC Microcomputer Martin Phillips Beginner's Guide to Interfacing the BBC Microcomputer Martin Phillips The Complete Disc Manual for the BBC Microcomputer R.I. M. Sadek File Handling on the BBC Microcomputer Brian J. Townsend Good BASIC Programming on the BBC Microcomputer Margaret White Other books of related interest Advanced Graphics with the IBM Personal Computer Ian 0. Angell Advanced Graphics with the Sinclair ZX Spectrum Ian 0. Angell and Brian J. Jones Micro-Maths Keith Devlin Geometric and Artistic Graphics: Design Generation with Microcomputers Jean-Paul Delahaye Practical BASIC Programming Peter Gosling Word Processing with Amstrad: The PCW8256 and 8512 Ron Hughes The Commodore 64 in Action M. M. Novak Computer Literacy: A Beginners' Guide Vincent Walsh The Computer Handbook: A Businessman's Guide Charles Jones Understanding Management Software Andrew Leigh

Advanced Graphics with the Commodore 128 M. M. Novak University of Bristol M MACMILLAN EDUCATION

M. M. Novak 1986 All rights reserved. No reproduction, copy or transmission of this publication may be made without written permission. No paragraph of this publication may be reproduced, copied or transmitted save with written permission or in accordance with the provisions of the Copyright Act 1956 (as amended). Any person who does any unauthorised act in relation to this publication may be liable to criminal prosecution and civil claims for damages. First published 1986 Published by MACMILLAN EDUCATION LTD Houndmills, Basingstoke, Hampshire RG21 2XS and London Companies and representatives throughout the world Publishing services by Ponting-Green, Basingstoke and London Photoset by Parker Typesetting Service, Leicester' British Library Cataloguing in Publication Data Novak,M.M. Advanced graphics with the Commodore 128. 1. Computer graphics 2. Commodore 128 (Computer)-Programming I. Title 006.6'865 T385 ISBN 978-1-349-08699-3 DOl 10.1007/978-1-349-08697-9 ISBN 978-1-349-08697-9 (ebook)

Contents Preface Acknowledgments 1 Elements of Computer Graphics 1 Display file Selecting the colour Defining the graphic modes Graphic images on the screen Mixing colours Multicolour high-resolution mode Freehand drawing Saving and retrieving the display file Hardcopy output Graphical input devices 2 Geometry in Two Dimensions 17 Points and coordinates Lines Scalars and vectors Line generation Circles and other curves Polar coordinates Line plotting or point plotting? 3 Data Presentation 34 Histograms Pie-charts Graphs Labelling the display Printer output Graphic windows vii viii

4 Two-dimensional Transformations 49 What is a transformation? Transformations and matrices Rotation about an arbitrary point Regular polygons Clipping 5 Modelling in Two Dimensions 70 Area fill Interpolating functions Contour mapping Fractal geometry Tiling the plane 6 Geometry in Three Dimensions 96 Coordinate systems Vectors Lines and planes 7 Transformations in Three Dimensions 108 Translation, scaling and rotation Inverse transformations Concatenation Rotation about an arbitrary axis Transforming coordinate axes 8 Displaying Three-dimensional Objects on the Screen 119 Eye coordinate system Parallel projection Orthographic projection General parallel projection Perspective projection Bodies of revolution 9 Suppression of Hidden Lines and Surfaces 135 Facet polarity Bodies of revolution The painter's approach Projecting a function Z = F(XY) Appendix 156 Bibliography 158 Index 159

Preface Computer graphics is one of the newest and most exciting areas in computing. The images produced on the screen are often fascinating, and our direct involvement with their creation is very rewarding. In recent years, with the availability of more powerful processors, the implementation of computer graphics became possible even on microcomputers. The field of graphics is currently undergoing rapid expansion and it is being used in many different walks of life. In this book I cover most of the essential topics involving computer graphics. As no prior knowledge of graphics is required, the introduction of new concepts begins at an elementary level. This book does not pretend to teach BASIC and it is assumed that you are familiar with the version as supplied on the Commodore 128. The large number of programs found throughout the book illustrate how the theoretical concepts can be implemented in practice. These programs are designed to clarify and teach various aspects of computer graphics. To enhance your understanding, many programs deal with simple objects. Extension to more complicated shapes is, in principle, straightforward. The book begins by introducing various topics essential to computer graphics. These cover picture representation, some graphic commands, saving and restoring the generated image and some of the graphic peripherals. Computer graphics is closely connected to elementary geometry. In Chapter 2, we revise the basic notions, such as scalars, vectors, and lines as described in the Cartesian system of coordinates. In Chapter 3 the common data display techniques are explained. That chapter covers the creation of histograms, pie-charts and graphs, and illustrates how to label your graphic displays. In addition, the ultra high resolution available on many good printers is presented. The essential part of computer graphics entails various transformations. The most frequent of these, such as translation, rotation, and scaling, that occur in two dimensions are detailed in Chapter 4. That chapter concludes with a description of a clipping routine that can be used to create graphic windows. Hatching, B-splines, and contours are discussed in Chapter 5. You will also find out how to create fantastic fractal images and Escher-like patterns.

viii Preface Lines, planes, and their mutual positions in three dimensions are described in Chapter 6. This is followed, in Chapter 7, by various transformations as used in three-dimensional space. Having learnt the required background theory, in Chapter 8 you find how to display objects on the screen. Both parallel and perspective projections are explained, as is the analysis of creating bodies of revolutions. The final chapter introduces the complex problem of suppression of invisible lines and surfaces. After studying this book you should have sufficient knowledge to develop numerous graphic programs of your own, whether for business, teaching, or enjoyment. Bristo/1985 M.M.NOVAK

Acknowledgements Production of a book depends on a concerted effort of many people who are not mentioned anywhere in the book. It is my pleasure to select a few who made creation of this book that much easier. I would like to thank Doreen Camilleri Novak for final preparation of all drawings and for critical deliberations during the various stages of the manuscript. In addition, I would like to mention Jon Finegold of Macmillan Education, whose enthusiasm made this book possible. Finally, I would like to single out and thank the following companies for suporting the preparation of this book: Star Micronics UK Ltd- for provision of the reliable, high-quality SG-10 printer FCC Systems Ltd- for the flexible CBM/Centronics 92008/G interface Micro Pro International Ltd- for SuperScript 128, the powerful word processor Wigmore House Ltd- for the MS 2000 graphics mouse, a very useful peripheral BASF UK Ltd- for reliable disks used throughout Panorama Office Systems Ltd- for the Touchmaster Graphic Tablet Datapen Microtechnology Ltd- for the lightpen Commodore Business Machines UK Ltd- for supplying me with early production models of C-128 computer and 1570 disk drive

Software Diskette A diskette containing all the major programs in this book is available. It costs 10 (price subject to change) and can be obtained from the author. Please write to: Dr. M.M.Novak Dept. of Theoretical Chemistry University of Bristol Cantocks Close BRISTOL AvonBS81TS