Motivation
int main(int argc, char** argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); glutInitWindowSize(600, 400); glutInitWindowPosition(100, 100); glutCreateWindow("Megacooles Spiel"); init(); gluPerspective(60, 600.0f / 400.0f, 0, 1000); glutDisplayFunc(display); glutIdleFunc(display); glutMainLoop(); return 0; }
Motivation
void init(void) { glMatrixMode(GL_PROJECTION); glLoadIdentity(); //glOrtho(0.0, 600.0, 0.0, 400.0, -1.0, 1.0); } void timer(int t) { angle += 30 * t; display(); }
Motivation
void display(void) { glClear (GL_COLOR_BUFFER_BIT); angle += 0.05f; glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glTranslatef(0, 0, -10.0f + (cos(angle / 180.0 * 3.141592654) + 1) / 2 * 8); glRotatef(angle, 0, 1, 0); glBegin(GL_LINE_STRIP); glColor3f(1, 0, 0); glVertex3f(-0.5, -0.9f, 0); glColor3f(0, 1, 0); glVertex3f(-0.5f, 0.0f, 0); glColor3f(0, 0, 1); glVertex3f(0.0f, 0.9f, 0); glColor3f(1, 1, 0); glVertex3f(0.5f, 0.0f, 0); glColor3f(1, 0, 1); glVertex3f(-0.5f, 0.0f, 0); glColor3f(0, 1, 1); glVertex3f(0.5f, -0.9f, 0); glColor3f(1, 1, 1); glVertex3f(-0.5f, -0.9f, 0); glColor3f(0, 1, 1); glVertex3f(0.5f, 0.0f, 0); glColor3f(1, 0, 1); glVertex3f(0.5f, -0.9f, 0); glEnd(); glutSwapBuffers(); }
Motivation
Inhalt
- Einführung - Was kann Unity?
-
Grundlagen
- Zielplattformen
- Der Editor
- Objektimport
- GameObjects
- Szenengraph
- C#-Scripting
- Erster Prototyp
- Zweiter Prototyp
- Netzwerkfähiger Prototyp
Einführung - Was kann Unity?
-
3D-Grafik-Engine auf dem aktuellen Stand der Technik
- Deferred Shading
- Bumpmapping
- Environment Mapping
- Parallax Mapping
- Ambient Occlusion
- dynamische Schatten
- Render-to-Texture
- Postprocessing-Effekte
-
Animation
- Pfadanimation
- Script-Animation
- PhysX-Simulation
-
Character Animation
- Skin & Bones
- Mecanim
Einführung - Was kann Unity?
Einführung - Was kann Unity?
Einführung - Zielplattformen
- Windows, Linux, Mac OS X
-
Konsolen
- Nintendo Wii
- Microsoft XBox 360
- Sony PlayStation 3
-
Mobile Endgeräte
- iOS
- Android
- Windows Phone 8
- Blackberry
-
WebBrowser
- Unity Webplayer Plugin (alle Browser)
- Adobe Flash Player
Grundlagen - Der Editor
Grundlagen - Objekte importieren
4 einfache Schritte zum Import:
- Objekt/Asset erstellen
- Drag'n'Drop
- Kaffee trinken gehen
- Asset verwenden
Grundlagen - GameObjects
- Hauptobjekte für die Interaktion
-
Enthalten Komponenten
- Komponenten bestimmen Verhalten
- Vorgefertigte vs. eigene Komponenten
- Komponenten haben Eigenschaften
- Komponenten sind (de)aktivierbar
Grundlagen - Der Szenengraph
Grundlagen - C#-Scripting
Erster Prototyp
- Plattform (Cube)
- Spieler (Capsule)
-
Steuerungsscript
- Benutzt CharacterController
[RequireComponent(typeof(CharacterController))]
- Eingabe über
Input.GetAxis(string name)
- Bewegung über
GetComponent<CharacterController>.Move(Vector3 dir)
- Benutzt CharacterController
Zweiter Prototyp
-
Gegner mit Einfache Künstliche Intelligenz
- Bei einer Entfernung 10m ≤ x ≤ 25m: Auf Spieler zulaufen
- Bei einer Entfernung x < 10m auf Spieler schießen
- Abschießen von Gegnern
- Verwendung von 3D-Modellen
Netzwerkfähiger Prototyp
-
Synchronisation der Spieler-Positionen
- Computer-Gegner vorerst wieder entfernt
- RPC , wenn gefeuert wird