решил немного переделать 2д систему. теперь можно выводить 2д графику так называемыми кусками. Причем внетри одного куска может быть дргой (вся графика внутреннего куска будет выводиться с учетом трансформации родительской геометрии).
как то так:
Begin2D();
Translate2D(carx,cary);
Turn2D(carangle);
car->Draw();
Begin2D();
Translate(-10,wheel1_suspendy);
wheel->Draw();
End2D();
Begin2D();
Translate(10,wheel2_suspendy);
wheel->Draw();
End2D();
End2D();
(осторожно, скрин получился весомым)
New2DSystemTest.zip

#define SIGEL_USE_ONLY
#include <sigel/ISigel.h>
float a=0;
Shape *star = 0;
void DrawFigure(int x,int y)
{
Begin2D();
Translate2D(x,y);
Turn2D(a);
Scale2D(2);
StartTextDraw();
for(int i=0;i<360;i+=5)
{
Color(hsl(i*255/360,255,128));
Begin2D();
Turn2D(i);
Translate2D(100,0);
Scale2D(0.75f);
char buff[32];
sprintf_s(buff,32,"angle: %f",AngleNormalize(a+i));
Text(buff,0,0);
End2D();
}
EndTextDraw();
star->Draw();
Begin2D();
Turn2D(a * -2);
Scale2D(2.3);
star->Draw();
End2D();
for(int i=0;i<6;++i)
{
Scale2D(0.8f);
Turn2D(a * 0.5);
star->Draw();
}
End2D();
}
sGAME
{
debug::startlog();
//Init(800,600,32,2,8);
Init();
AppTitle("ShapesTest");
VWait(0);
CameraHelper ch;
TFont *fnt = new TFont("tahoma.txt");
fnt->Bind();
#define CREATE_NEW_STAR_SHAPE
#ifdef CREATE_NEW_STAR_SHAPE
int cntl = 128;
star = new Shape(cntl*3,cntl*3);
for(int i=0;i<cntl*3;++i)
{
star->SetIndex(i,i);
}
float r1 = 75;
float r2 = 100;
for(int i=0;i<cntl;++i)
{
float a = (float)i * 6.283f / (float)cntl;
float da = 6.283f / (float)(cntl*2);
float x,y;
x = sin(a)*r2;
y = cos(a)*r2;
star->SetVertexPos(i*3 + 0,x,y);
star->SetVertexColor(i*3 + 0,255,255,0);
x = sin(a-da)*r1;
y = cos(a-da)*r1;
star->SetVertexPos(i*3 + 2,x,y);
star->SetVertexColor(i*3 + 2,255,0,0);
x = sin(a+da)*r1;
y = cos(a+da)*r1;
star->SetVertexPos(i*3 + 1,x,y);
star->SetVertexColor(i*3 + 1,255,0,0);
}
star->SetPrimType(GL_TRIANGLES);
star->Save("megastar.shape");
star->DrawMode(SDM_STATIC);
#else
star = new Shape("megastar.shape");
#endif
float dt=0;
a=0;
Start2D();
while(!KeyDown(VK_ESCAPE))
{
dt = GetFrameTime();
a+=dt*0.01f;
Render();
Blend(BM_ADD);
fnt->Smooth(1);
DrawFigure(0,0);
DrawFigure(0,ScreenHeight());
DrawFigure(ScreenWidth(),0);
DrawFigure(ScreenWidth(),ScreenHeight());
DrawFigure(ScreenWidth()/2,ScreenHeight()/2);
fnt->Smooth(0);
Color(255,255,255,255);
Text(GetFPS(),10,10);
Flip();
//Delay(16.67f);
}
DeInit();
debug::endlog();
};