55
3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Embed Size (px)

Citation preview

Page 1: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

3D Grafik: Mathe

Softwaretechnologie II (Teil 1): Simulation und 3D ProgrammierungAufbaumodul 1WS 2014/2015

Herr Manfred ThallerMaria Wagner

Page 2: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Was ist eigentlich 3D Grafik?

Page 3: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner
Page 4: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Projection

X`= x/zY`=y/z

Page 5: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Polygongrafik

Page 6: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Vektoren

• Ansammlung von Werten

• v1 : Erste Komponente des Vektors

• Xv : X Komponente des Vektors V

Page 7: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Positionsvektoren

• Ort im Raum innerhalb eines Koordinatensystems

• Absolut vs. Relative Position

Page 8: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Richtungsvektoren

• Beschreibt Bewegungsrichtung eines Objekts• Geschwindigkeit wird auch angeben

Bewegungsvektor • Bsp.:

Vektor (-1,0,0) Bewegung: Einheit pro sec nach links

Page 9: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Rechenoperationen 1

a+b = (xa + xb ; ya + yb; za + zb)

a-b = (xa - xb ; ya - yb; za - zb) • Bsp.:

Ball mit Positionsvektor p und Bewegungsvektor v (t: abgelaufene Zeit)

p`= p+ (v+t)

Page 10: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Rechenoperationen 2

• Vektor mit Skalar: A . S = (xa . S; ya . S; za. S)

a/s = (xa/s; ya/s; za/s)

– Multiplikation eines Vektors mit einem Skalar: Verlängerung

– Division: Stauchung

Page 11: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Punktprodukt

• Zwei Richtungsvektoren multiplizieren: – Zwischen zwei Rv den eingeschlossenen Winkel

bestimmen– Ergebnis = Skalar / Kosinus des Winkels

Bsp.: a . b = (xa . Xb ; ya . yb; za. zb)

Verwendung: Winkel 90o? Produkt = 0

Page 12: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Kreuzprodukt

• Ergebnis ist ein neuer Vektor

a x b = cc = (ya x zb - za x yb; za x xb - xa x zb; xa x yb - ya x xb )

Page 13: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Länge eines Vektors

• Bsp.: – Ball hat den Bewegungsvektor (3, 4, 0)

• Wie berechnet man die Vektorlänge?

Satz des Pythagoras!• |v|= Wurzel von (xv

2+ yv2 + zv

2 )• Verbindungsvektor• | AB | = | b – a |

Page 14: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Programmieren einer Vektorklasse

#ifdef TRIBASE_EXPORTS

#define TRIBASE_API __declspec(dllexport)

#else

#define TRIBASE_API __declspec(dllimport)

#endif

tbVector3 //Name der Klasse

{

public:

float x, y, z; //Vektorkomponenten

};

Page 15: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Konstruktoren implementieren

1) tbVector3 () {} // tut nichts 2) tbVector3 (const tbVector3& v) : x(v.x), y(v.y),

z(v.z) {} //Kopierkonstruktor 3) tbVector3 (const float vx,

const float vy, const float vz) : x(v.x), y(v.y), z(v.z)

// setzt angegeben Vektorkomponenten ein

Page 16: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Globale Operatoren

Inline tbVector3 operator + (const tbVector3& a,

const tbVector3& b)

{

return tbVector3 (a.x + b.x, a.y + b.y, a.z + b.z);

}

//Addition von zwei Vektoren

Page 17: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Zuweisungsoperatoren• =, +=, -=, *=, /=• Innerhalb der Klasse definiert

//Zuweisung und Addition tbVector3& operator += (const tbVector3& v)

{

x += v.x; // Vektor v hinzuaddieren

y += v.y;

z += v.z;

return *this;

}

Page 18: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Vergleichsoperatoren• ==; !=• Überprüfung der Gleichheit oder Ungleichheit zweier Vektoren

// Sind a und b gleich? bool operator == tbVector3& a,

tbVector3& b)

{

return a.x == b.x && a.y == b.y …;

}

(Bei Ungleichheit: eine Komponente reicht, um ungleich zu sein)

Page 19: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Vektorlänge

Satz des Pythagoras!

Inline float tbVector3Length (const tbVector3& v) {

return sqrtf (v.x * v.x + v.y * v.y + v.z * v.z); // Wurzel}

Page 20: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Kreuzprodukt

• Kreuzprodukt zweier Vektoren: Neuer Richtungsvektor

Inline tbVector3 tbVector3Cross (const tbVector3& a,

const tbVector3& b)

{

return tbVector3 ( a.y * b.z – a.z * b.y,

a.z * b.x – a.x * b.z,

a.x * b.y – a.y * b.x);

}

Zur erinnerung: c = (ya x zb - za x yb; za x xb - xa x zb; xa x yb - ya x xb )

Page 21: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Minimum- und Maximumvektoren

Inline tbVector3 tbVector3Min (const tbVector3& a,

const tbVector3& b)

{

return tbVector3 (TB_MIN (a.x, b.x), TB_MIN (a.y, b.y), TB_MIN (a.z, b.z));

}

Page 22: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Zufallsvektoren

Inline tbVector3 tbVector3Random ()

{

return tbVector3NormalizeEx

( tbFloatRandom (-1.0f, 1.0f),

tbFloatRandom (-1.0f, 1.0f),

tbFloatRandom (-1.0f, 1.0f))));

}

Page 23: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Lineare Interpolation

• Positionsbestimmung eines Objekts zu einer gewissen Zeit• Objekte zw. Zwei Positionen linear bewegen• Interpolationsfaktor (Wert zwischen den zwei Vektoren Inline tbVector3 tbVector3InterpolateCoords (

const tbVector3& a,

const tbVector3& b,

const float s)

{

return a + s * (b-a)

}

Anmerkung: p = x + s*(y-x)

Page 24: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Fazit zu Vektoren

• Beschreiben:– Position eines Objektes– Bewegungsrichtung/Geschwindigkeit

• 3D Modell: Ansammlung von Punkten mit paar Zusatzinformationen

• Codebefehle auf Seite 63 zu sehen!

Doch wie ändert man das Objekt? Verschiebt, dreht man es?

Page 25: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Matrizen

Page 26: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Operatoren

Page 27: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Transformation

• Drehungen, Verschiebungen, Vergrößerungen• Positionsvektoren sind relativ zum

Objektmittelpunkt• Arten:

– Translation– Skalierung– Rotation– Spiegelung

Page 28: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Vektor transformieren

• Vektor ( x y z ) (x y z 1) * Transformationsmatrix

• Ähnlich auch im Code eines Positionsvektors (s.S.85)

Page 29: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Translationsmatrix

• Position• Verschiebt Vektor um einen bestimmten

Verschiebungsvektor (d) • Simple Vektoraddition

Page 30: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Skalierungsmatrix

• Größe• Mit einem bestimmten Faktor den Vektor

multiplizieren (Vergrößerung | Verkleinerung)• S = Skalierungsvektor (Skalierung auf jeder

Achse)

Page 31: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Rotationsmatrix• Gleichung zur Drehung eines Punktes um den Koordinatenursprung:• Es muss beachtet werden, welche Komponenten angesprochen werden

x = (x * cos α) + (y * (- sin α))y = (x * sin α) + (y * cos α)

Page 32: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Beispiel

Ein Raumschiffmodell soll auf die Position (x1, y1, z1) gebracht werden und ein Winkel von

45 Grad um die y-Achse gedreht werden.Welche Matrizen müssen verwendet werden?

Page 33: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Projektionsmatrix

• Projektion eines dreidimensionalen Vektors auf eine Ebene (Bildschirm)

Page 34: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Kameramatrix

Page 35: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Praktischer Teil

• Konstruktor: 16 float Variablen: kopiert die Werte in die Matrix rein

tbMatrix (float c11, float c12, float c13, float c14, float c21, float c22, float c23, float c24,

float c31, float c32, float c33, float c34,float c41, float c42, float c43, float c44) :

m11(c11), m12(c12), m13(c13), m14(c14) …

Page 36: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Operatoren

• Gleich wie bei Vektoren-Operatoren, außer• Multiplikation zweier MatrizenInline tbMatrix operator * ( const tbMatrix& a,

const tbMatrix& b){ return tbMatrix (b.m11 * a.m11 + b.m12 * a.m12 etc ); Jeder mit jedem

Page 37: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Zugriffoperatoren• Wenn man auf ein Element der Matrix zurückgreifen will:tbMatrix m; //Element in Zeile1, Spalte 3 auf den Wert 17 setzenM (1,3) = 17.0f

• Zur Übergabe von Variablen benötigt man ein zweidimensionales Arrayclass TRIBASE_API tbMatrix{

public:union {

struct {float m11, m12, m13, m14, //Elemente der Matrix

m21, m22, m23, m24,m31, m32, m33, m34,m41, m42, m43, m44; }

float m[4] [4] };

Page 38: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Translationsmatrix

tbMatrixTranslation //erwartet den Verschiebungsvektor

TRIBASE_API tbMatrix tbMatrixTranslation (const tbVector3& d){

return tbMatrix ( 1.0f, 0.0f, 0.0f, d.x, 0.0f, 1.0f, 0.0f, d.y, 0.0f, 0.0f, 1.0f, d.z, 0.0f, 0.0f, 0.0f, 1.0f);

}

Page 39: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Skalierungsmatrix

TRIBASE_API tbMatrix tbMatrixScaling (const tbVector3& s){

return tbMatrix ( s.x, 0.0f, 0.0f, 0.0f, 0.0f, s.y, 0.0f, 0.0f, 0.0f, 0.0f,s.z, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f);

}

// Auf allen drei Ebenen

Page 40: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Kameramatrix1. Translationsmatrix entgegengesetzt erzeugen2. Achsenvektoren der Kamera in Matrix

1. X-Achse in erste Spalte, Y-Ache in zweite etc.

3. Beide Matrizen multiplizieren

TRIBASE_API tbMatrix tbCamera ( const tbVector3& vPos, const tbVector3& vLookAt, const tbVector3& vUp) // Kamera steht senkrecht (0,1,0){

tbVector3 vZAxis (tbVector3Normalize (vLookAt – vPos)); //z Achse berechnet

// x und y Achse durch z-Produkt berechnettbVector3 vZAxis (tbVector3Normalize (tbVector3Cross(vUp, vZAxis))); tbVector3 vZAxis (tbVector3Normalize (tbVector3Cross(vAxis, vZAxis)));

}

Page 41: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Weitere Hilfsfunktionen

• tbMatrixAxes • Man übergibt Achsenvektoren zur Berechnung der

Achsenmatrix• Ausgabe der Ausrichtung eines Objekts

• tbMatrixDet• Bestimmt Determinante einer Matrix

• tbMatrixInvert• Invertiert angegebene Matrix

• tbMatrixTranspose• Transponiert eine Matrix

Page 42: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Weitere Hilfsfunktionen

• tbMatrixcamera• Kameramatrix berechnen durch Positionsvektor vPos,

Richtungsvektor vLookAt und „Nach-Oben-Vektor“ vUp für Kameradrehung

• Translationsmatrix wird entgegengesetzt der Kameraposition erzeugt

• Achsenvektoren der Kamera in eine Matrix eintragen• Beide multiplizieren und man erhält die Kameramatrix

• tbMatrixProjection• Erzeugt eine Projektionsmatrix

Page 43: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Weitere Hilfsfunktionen

• tbVector3TransformCoords• Positionsvektor mit Matrix multiplizieren• W-Koordinate wird für den Fall einer Projektion

geprüft• tbVector3TransformNormal

• Richtungsvektor mit Matrix multiplizieren• Hierfür wird ursprüngliche Länge gespeichert

Auch die Matrix kann man ins Logbuch schreiben tbWriteMatrixToLog

Page 44: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Ebenen

Page 45: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Ebenengleichung

• Flache Oberfläche im 3D Raum (endlos)• Ebenengleichung: Menge der Punkte• Stützvektor

• Liegt in der Ebene• Normalenvektor

• Steht senkrecht auf der Ebene• Verbindet man einen Punkt mit dem

Stützvektor muss der Verbindungsvektor senkrecht zum Normalenvektor stehen

Page 46: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Lage eines Punktes

• Durch Ebenengleichung lässt sich herausfinden ob ein Punkt auf der Ebene liegt

• Ergebnis +: Punkt auf der Vorderseite• Ergebnis -: Punkt auf der Rückseite• Ergebnis der Ebenengleichung wird mit

Normalenvektor dividiert um Entfernung des Punktes zu der Ebene herauszufinden

Page 47: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Implementierung

• tbPlane• Vier Variablen (Fließkommazahlen) a, b, c und d• Zusätzlich eine tbVector3-Variable n

(Normalenvektor)• Kopierkonstruktor• Leerer Konstruktor• Konstruktor der vier float-Werte erwartet • Konstruktor, der tbVector3-Wert und einen float-

Wert erwartet• Operatoren gibt es nicht

Page 48: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Ebene erstellen

tbVector3 a (-5.0f, -1.0f, 7.0f);tbVector3 b (1.0f, 2.0f, 8.0f);tbVector3 c (7.0f, -4.0f, 9.0f);

tbPlane Plane (tbPlaneFromPoints (a,b,c));tbWritePlaneToLog (Plane);

Page 49: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Hilfsfunktionen

• tbPlaneNormalize• Normalisiert Ebenen

• tbPlaneDotNormal • Punktprodukt aus einem Vektor und dem

Normalenvektor aus der Ebene• tbPlaneDotCoord

• Soll Punkt in Ebenengleichung einsetzen und das Ergebnis zurückliefern

• tbPointPlaneDistance• Distanz eines Produkts zur Ebene

Page 50: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Hilfsfunktionen

• tbPlaneFromPointNormal• Erwartet einen Punkt und einen Normalenvektor

und liefert die Ebene• tbPlaneTransform

• Man kann auch Ebenen mit Matrizen transformieren

• tbWritePlaneToLook• Schreibt eine Ebene in die Logbuchdatei

Page 51: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

RGB Farbsystem

Page 52: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Farbsystem

• 8-Bit Grafik erschwerte eine Farbgebung• 16-Bit-Grafik

• Darstellung eines Pixels basierte auf dem RGB-System

• 16 Bits aufgeteilt in 5 Rotanteile, 6 Grünanteile und 5 Blauanteile

• 24-Bit-Grafik • 32-Bit-Grafik

• 8 Bits : Transparenz

Page 53: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Implementierung

• Durch Konstruktor:1. tbColor c(1.0f, 0.0f, 0.0f) ; //Rot

tbColor d(0.0f, 1.0f, 0.0f, 0,5f); //transparentes Grün2. DWORD Wert:

tbColor g ((DWORD) (FF00FF80); //Violett

Page 54: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Fazit

• Vektoren• Matrizen

– Transformationen• Ebenen• RGB Farbsystem

Page 55: 3D Grafik: Mathe Softwaretechnologie II (Teil 1): Simulation und 3D Programmierung Aufbaumodul 1 WS 2014/2015 Herr Manfred Thaller Maria Wagner

Danke für die Aufmerksamkeit!