Unit1.cpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #pragma hdrstop
  4. #include "Unit1.h"
  5. //---------------------------------------------------------------------------
  6. #pragma package(smart_init)
  7. #pragma link "GLBaseClasses"
  8. #pragma link "GLCoordinates"
  9. #pragma link "GLCrossPlatform"
  10. #pragma link "GLObjects"
  11. #pragma link "GLScene"
  12. #pragma link "GLVectorFileObjects"
  13. #pragma link "GLWin32Viewer"
  14. #pragma link "GLFile3DS"
  15. #pragma resource "*.dfm"
  16. TForm1 *Form1;
  17. //---------------------------------------------------------------------------
  18. __fastcall TForm1::TForm1(TComponent* Owner)
  19. : TForm(Owner)
  20. {
  21. }
  22. //---------------------------------------------------------------------------
  23. void __fastcall TForm1::FormCreate(TObject *Sender)
  24. {
  25. const String
  26. cFileName = "polyhedron.3ds";
  27. SetGLSceneMediaDir();
  28. // left one
  29. FreeForm3->AutoCentering = FreeForm3->AutoCentering << macCenterX, macCenterZ;
  30. FreeForm3->LoadFromFile(cFileName);
  31. // central one
  32. FreeForm2->AutoCentering = FreeForm2->AutoCentering << macCenterY;
  33. FreeForm2->LoadFromFile(cFileName);
  34. // right one
  35. FreeForm1->AutoCentering = FreeForm1->AutoCentering << macCenterX, macCenterY, macCenterZ;
  36. FreeForm1->LoadFromFile(cFileName);
  37. }
  38. //---------------------------------------------------------------------------
  39. void __fastcall TForm1::TrackBar1Change(TObject *Sender)
  40. {
  41. DCCamera->PitchAngle = TrackBar1->Position;
  42. }
  43. //---------------------------------------------------------------------------