/
SergeyGerasimov
/
VRLabs
Обзор
Документация
Войти
/
SergeyGerasimov
/
VRLabs
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Lab4_SolarSys/fcGlobus.cpp
98 строк
3 KB
SergeyGerasimov
Загрузка всех лабораторных работ
01 май 2026, 15:32
01 май 2026, 15:32
83d1a16
Код
Авторство
О чём код?
//--------------------------------------------------------------------------- #include <vcl.h> #pragma hdrstop #include "fcGlobus.h" #include <Vcl.Imaging.jpeg.hpp> #include "GLS.Material.hpp" #include "GLS.Color.hpp" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma link "GLS.BaseClasses" #pragma link "GLS.Coordinates" #pragma link "GLS.Objects" #pragma link "GLS.Scene" #pragma link "GLS.SceneViewer" #pragma link "GLS.SimpleNavigation" #pragma link "GLS.GeomObjects" #pragma link "GLS.Material" #pragma link "GLS.Cadencer" #pragma resource "*.dfm" TFormGlobe *FormGlobe; //--------------------------------------------------------------------------- __fastcall TFormGlobe::TFormGlobe(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TFormGlobe::FormCreate(TObject *Sender) { sfPlanet->Material->Texture->Enabled = true; sfGrid->Material->Texture->Enabled = true; sfClouds->Material->Texture->Enabled = true; diskCore->Material->Texture->Enabled = true; SunSphere->Material->Texture->Enabled = true; MoonSphere->Material->Texture->Enabled = true; SunSphere->Material->Texture->Image->LoadFromFile("assets\\maps\\sun.jpg"); MoonSphere->Material->Texture->Image->LoadFromFile("assets\\maps\\moon.jpg"); // sfGrid->Material->Texture->Image->LoadFromFile("assets\\maps\\unigrid.bmp"); sfGrid->Material->Texture->Image->LoadFromFile("assets\\maps\\celestial_grid.jpg"); // sfGrid->Material->BlendingMode = bmAdditive; } //--------------------------------------------------------------------------- void __fastcall TFormGlobe::TreeView1Change(TObject *Sender, TTreeNode *Node) { // ���������, ��� �������� �� ������������� ���� if (Node == nullptr) return; sfPlanet->Start = 0; sfPlanet->Stop = 360; if (Node->Text == "����������") { sfPlanet->Material->Texture->Image->LoadFromFile("assets\\maps\\topography.jpg"); } if (Node->Text == "�����������") { sfPlanet->Material->Texture->Image->LoadFromFile("assets\\maps\\temperature.jpg"); } else if (Node->Text == "��������") { sfPlanet->Material->Texture->Image->LoadFromFile("assets\\maps\\exoaqua.jpg"); }; if (Node->Text == "����") { sfPlanet->Stop = 180; // ��������������� ����� ��������� ����� sfPlanet->Material->Texture->Image->LoadFromFile("assets\\maps\\earth_east.jpg"); // ���������� ����� ������� � ����� ����� diskCore->Material->Texture->Image->LoadFromFile("assets\\maps\\earth_core.jpg"); } if (Node->Text == "������") { // �������� �������� ������� sfClouds->Material->Texture->Image->LoadFromFile("assets\\maps\\clouds.jpg"); } } //--------------------------------------------------------------------------- void __fastcall TFormGlobe::GLCadencer1Progress(TObject *Sender, const double DeltaTime, const double NewTime) { const double EarthOrbitSpeed = 30.0; const double MoonOrbitSpeed = 360.0; static double earthAngle = 0; static double moonAngle = 0; earthAngle += EarthOrbitSpeed * DeltaTime; moonAngle += MoonOrbitSpeed * DeltaTime; OrbitEarth->TurnAngle = earthAngle; OrbitMoon->TurnAngle = moonAngle; Earth->TurnAngle += 360 * DeltaTime; } //---------------------------------------------------------------------------