Facebook
From Crippled Kitten, 8 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 429
  1. // Punkt.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "openGL.h"
  6. #include "Punkt.h"
  7. #include "afxdialogex.h"
  8.  
  9. CPunkt::CPunkt()
  10. {
  11.  
  12. }
  13.  
  14. CPunkt::~CPunkt()
  15. {
  16. }
  17.  
  18.  
  19. CPunkt::CPunkt(int x, int y, int z) // nasz konstruktor
  20. {
  21. // tutaj proszę dodać kod, który będzie wpisywał do tablicy “pozycja” wartości początkowe x, y, z
  22.         pozycja[0]=x;
  23.         pozycja[1]=y;
  24.         pozycja[2]=z;
  25. }
  26.  
  27. void CPunkt::rysuj(double r, double g, double b){ //rysuje punkt w przestrzeni
  28. glColor3f(r,g,b); //ustalamy kolor punktu
  29. glBegin(GL_POINTS);//rysujemy punkt
  30. glVertex3f(pozycja[0], pozycja[1], pozycja[2]);
  31. glEnd();
  32. }
  33.  
  34. void CPunkt::przesun(int dx, int dy, int dz){ //przesuwa punkt w przestrzeni
  35. pozycja[0]+=dx;
  36. pozycja[1]+=dy;
  37. pozycja[2]+=dz;
  38. }
  39.