Small OpenGL based c++ rendering library
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

quader.cpp 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* libsegl - Sebas Extended GL Library
  2. * Collection of Opengl/3D-Math helpers
  3. *
  4. * Copyright (c) 2008 by Sebastian Lohff, seba@seba-geek.de
  5. * http://www.seba-geek.de
  6. *
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Library General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Library General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Library General Public
  18. * License along with this library; if not, write to the
  19. * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
  20. * Boston, MA 02110-1301, USA.
  21. */
  22. #include "quader.h"
  23. namespace segl {
  24. void Quader::clean() {
  25. a.set(0.0f, 0.0f, 0.0f);
  26. b = c = d = e = f = g = h = a;
  27. }
  28. void Quader::render() {
  29. glBegin(GL_LINES);
  30. glVertexP3D(a);
  31. glVertexP3D(b);
  32. glVertexP3D(b);
  33. glVertexP3D(c);
  34. glVertexP3D(c);
  35. glVertexP3D(d);
  36. glVertexP3D(d);
  37. glVertexP3D(a);
  38. glVertexP3D(e);
  39. glVertexP3D(f);
  40. glVertexP3D(f);
  41. glVertexP3D(g);
  42. glVertexP3D(g);
  43. glVertexP3D(h);
  44. glVertexP3D(h);
  45. glVertexP3D(e);
  46. glVertexP3D(a);
  47. glVertexP3D(e);
  48. glVertexP3D(b);
  49. glVertexP3D(f);
  50. glVertexP3D(c);
  51. glVertexP3D(g);
  52. glVertexP3D(d);
  53. glVertexP3D(h);
  54. glEnd();
  55. }
  56. } // namespace segl