Short Courses on Computer Graphics, Image Processing and Computer Vision


Let me know what you think Mail me...

Course 2DJava: 2D-Computer Graphics with Java

Copyright © by V. Miszalok, last update: 30-10-2002

  Visitors since 01-01-2002 layout: thanks to Stefan Münz
deutsch english
Einführung
C1: Intro, erste Graphikbefehle
C2: Draw, ein Malprogramm
C3: XML, speichern und lesen von Polygonen in drei Formaten
C4: Anim, eine Animation
Introduction
C1: Intro, some simple graphic commands
C2: Draw, a scribble program
C3: XML, store and read polygons in three different formats
C4: Anim, an endless animation

C1: Intro, erste Graphikbefehle

Schreiben Sie ein erstes zweckloses Graphikprogramm. Es enthält den Hello-World-Text, es erfragt die dehnbare Fenstergröße, schreibt zwei Linien, ein Rechteck, eine Ellipse. Es zieht sternförmig dicke Linien mit Zufallsfarben und speichert die Endpunkte in einem Polygonarray, das am Ende zackenförmig rot gezeichnet wird.
Spielen Sie mit dem Programm, indem Sie das Fenster mit der Maus zoomen.

C1: Intro, some simple graphic commands

Write Your first useless Java-program that demonstrates some simple graphic commands. It demonstrates a Hello-World-text, it evaluates the variable window size, draws two lines, a rectangle and an ellipse. It draws thick radial lines using random colors. Finally it stores the end points of the lines in form of a polygon array which forms a final red splash. It redraws everything in a different way from scratch when you change the window size by dragging one of its borders.

Link Bauanleitung
PDF Bauanleitung Druckversion

C2: Draw, ein Malprogramm

Das Programm besteht aus 6 aufeinander aufbauenden Versionen V1 - V6.
V1: Zeichne die Mausbewegungen ohne sie zu speichern
V2: Anzeige der laufenden Mauskoordinaten
V3: Markieren der Vertices als Kästchen
V4: Minimalabstand zwischen Vertices verlangen
V5: Vertex Array
V6: Umfang, Fläche, Schwerpunkt, umschreibendes Rechteck

C2: Draw, a scribble program

This is a scribble program in 5 increasingly complex versions V1 - V6.
V1: Draw the raw mouse mouvements and forget them
V2: Display the current mouse coordinates
V3: Mark the vertices as small rectangles
V4: Ask for a minimal distance between adjacent vertices
V5: Vertex array
V6: Perimeter, area, center of gravity, surrounding rectangle

Link Bauanleitung
PDF Bauanleitung Druckversion

C3: XML, speichern und lesen von Polygonen in drei Formaten

Die von der Mausbewegung erzeugten Vertices werden zunächst in einem dynamischen Array gesammelt. Das gesamte Polygon kann anschließend dauerhaft unter beliebigem Namen auf die Platte gespeichert und von dort gelesen werden. Sie werden das Polygon im Textformat und in den beiden XML-Formaten Vector Markup Language VML und Scalable Vector Graphics SVG speichern, die Ihr Browser lesen und interpretieren kann. (VML: Internet-Explorer ab Version 5.0) (SVG: Adobe Plugin für IE, Netscape und Opera. Siehe: www.adobe.com/svg/viewer/install/main.htm).

C3: XML, store and read polygons in three different formats

At first, the vertices generated by the mouse movements are collected in a dynamic array. The complete polygon can be stored to and reloaded from the hard disk under an arbitrary file name. You will store it in text format and in the XML-formats Vector Markup Language VML and Scalable Vector Graphics SVG that your browser can read and interpret. (VML: Internet-Explorer Version 5.0 & higher) (SVG: Adobe Plugin for IE, Netscape und Opera. See: www.adobe.com/svg/viewer/install/main.htm ).

Link Bauanleitung
PDF Bauanleitung Druckversion

C4: Anim, eine Animation

Malprogramm mit Daueranimation. Das offene Polygon dreht und schrumpft um seinen Schwerpunkt und fängt dann an, rhytmisch zu pumpen in Schrittweiten von 1 Grad und 5% Zoom. Geschwindigkeit und Umkehrpunkte sind im Code frei regelbar.

C4: Anim, an endless animation

Scribble program followed by an endless animation.
The open polygone rotates and shrinks around its center of gravitiy and starts to breath in steps of 1 degree and a zoom of 5%. The animation velocity and the reversal points are programmable.

Link Bauanleitung
PDF Bauanleitung Druckversion

top of page: