Uploaded on

Darkonoid is the 3-d version of the old game Arkonoid (3-D …

Darkonoid is the 3-d version of the old game Arkonoid (3-D
Arkonoid=Darkonoid).

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
218
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
1
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. PRINCIPLES OF COMPUTER GRAPHICS FINAL PROJECT ORUÇ HÜSEYİN GÜRSOY
  • 2. 3-D ARKONOID = DARKONOID From 2-D to 3-D
  • 3. LAYOUT OF PRESENTATION
        • Introduction of Darkonoid
        • Objects used
        • How it works
  • 4. INTRODUCTION
            • 3-D Environment
            • Move your 3-D base with mouse,
            • Try to destroy 3-D items
            • Move your camera with keyboard
            • Score and info on seperate window
  • 5. 3-D GAME VOLUME (SEETHROUGH)‏ BASE (SEETHROUGH)‏ BALL LINE (To understand Ball's level)‏ BALL ITEMS to destroy RED = 5 points BLUE = 3 points GREEN = 1 points
  • 6. BALL : Sphere-like shaped, random coloured BASE : 6-GON shaped, seethrough (to see the ball)‏ Surface of the base is like round shaped, This gives you the minor control of the ball ! 
  • 7. ITEMS: RED = 5 points BLUE = 3 points GREEN = 1 points The ball bounces according to the side it hits SCOREBOARD
  • 8. Package Layout
    • arko_starter
      • ArkoStarter.java
    • geometries
      • geoms3D
        • N_gon3D.java
        • Obj3D.java
        • Point3D.java
      • Geometry.java
      • Matrix.java
    • renderer
      • MovementStatus.java
      • Renderer.java
  • 9. MATRIX
    • Matrix includes
      • public int satir; // #rows
      • public int sutun; // #columns
      • public double[][] sayi; // matrix items
    • Construction
      • public Matrix(int satir, int sutun)‏
      • public Matrix(Point3D p)‏
  • 10. MATRIX, methods
    • public void sifirla()‏
      • // makes identity
    • public void Esitle(Matrix e)‏
      • // makes equal to e
    • public void MultiplyWith(Matrix m)‏
      • // multiplies with m
    • public void transMatrix(double a,double b,double c)‏
      • // makes this matrix a translation matrix
    • public void scaleMatrix(double sx, double sy, double sz)‏
      • // makes this matrix a scaling matrix
    • public void rotateAroundY(double theta)‏
      • // makes this matrix a rotation matrix
    • public void rotateMatrixAroundPoint(Point3D p, double theta)‏
      • // makes this matrix a rotation around a Point matrix
    • public void strToConsole()‏
      • // writes matrix to console
  • 11. Geometry (base geometry)‏
    • Each Geometry has a Matrix t
    • Methods;
      • void display(GLAutoDrawable drawables);
      • void applyTransform(Matrix transform);
      • double range(Point3D p);
      • void renk(double r,double g,double b);
  • 12. Point3D
    • COORDINATES OF THE POINT
      • public double x;
      • public double y;
      • public double z;
    • COLOR OF THE POINT
      • public double r;
      • public double g;
      • public double b;
    • SPECİFİC METHODS
      • public void renkRandom()‏
  • 13. N_gon3D
    • N_gon3D has;
      • public int n;
      • public Point3D Points[];
      • public Point3D center;
    • Construction
      • public N_gon3D(Point3D center, double r1,double r2, int n)‏
      • center : center point
      • r1 : radius 1
      • r2 : radius 2
      • n : n of n_gon
  • 14. Obj3D
    • Obj3D has;
      • public N_gon3D alt;
      • public N_gon3D ust;
      • public int n;
      • public double r1;
      • public double r2;
      • public double h;
    • Construction
      • public Obj3D(int n, double r1,double r2, double h)‏
      • h : height of object
  • 15. How it works ?
    • Initialisation and creation,
      • Creation of the battle ground
      • Creation of the base
      • Creation of the ball
      • Creation of the items
    • At each display
      • apply the ball its transfomation matrix
      • detect a collision (with items or base or walls of the battle ground)‏
      • if (collision) calculate the appropriate transformation matrix of the ball and do the appropriate actions
  • 16. Range from a Plane
    • double rangeFromPlane(Point3D p, Point3D p1,Point3D p2,Point3D p3)‏
      • PLANE  ax + by + cz + d = 0
      • You must get into this form from three points...
  • 17. Range from a Plane
    • double a=p2.y*(p3.z-p1.z)+p1.y*(p2.z-p3.z)+p3.y*(p1.z-p2.z);
    • double b=p2.x*(p1.z-p3.z)+p1.x*(p3.z-p2.z)+p3.x*(p2.z-p1.z);
    • double c=p2.x*(p3.y-p1.y)+p1.x*(p2.y-p3.y)+p3.x*(p1.y-p2.y);
    • double d=-a*p1.x-b*p1.y-c*p1.z;
    • range=(a*p.x+b*p.y+c*p.z+d)/Math.sqrt(a*a+b*b+c*c);
    • return (double)range;
  • 18. Reflection from a Plane
    • get the normal of the plane
    • get the projection of your vector on the normal and negate it
    • add the 2 x result to your vector
  • 19. Round-like shaped surface
    • get the range from ball to the center,
    • rotate the normal by (asin(range/radius)/4)‏
    • do this in 3D (just two more steps)‏
  • 20. Making algorithm faster
    • range from items are calculated for all sides of items (two much operaton)‏
    • to avoid this ;
            • first range from one of the center points is calculated,
            • if this range is below some value then further check for collision is done