::: ++, , # :::

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
  // Unit1.Cpp
  //---------------------------------------------------------------------------
 
  #include 
  #pragma hdrstop
 
  #include "Unit1.h"
  //---------------------------------------------------------------------------
  #pragma package(smart_init)
  #pragma resource "*.dfm"
  #define eye 1
  TForm1 *Form1;
  float x1,x2,y,ax,ay,dx,rx1,rx2;
  TColor rgb;
  unsigned char color[3];
  GLUquadric *Sphere;
  GLfloat pos[]={200.0f,200.0f,-200.0f};
  GLfloat specular[]={1.0f,1.0f,1.0f,1.0f};
  GLfloat specref[]={1.0f,1.0f,1.0f,1.0f};
  GLfloat ambient[]={0.3,0.3,0.3,1.0};
  GLfloat diffuse[]={0.3,0.3,0.3,1.0};
  GLfloat pos1[]={-200.0f,-100.0f,-200.0f};
  GLfloat specular1[]={1.0f,1.0f,1.0f,1.0f};
  GLfloat ambient1[]={0.1,0.1,0.1,1.0};
  GLfloat diffuse1[]={0.1,0.1,0.1,1.0};
  //---------------------------------------------------------------------------
  __fastcall TForm1::TForm1(TComponent* Owner)
  : TForm(Owner)
  {
  Application->OnIdle=IdleLoop;
  }
  //---------------------------------------------------------------------------
  void __fastcall TForm1::IdleLoop(TObject *,bool &done)
  {
  Render();
  SwapBuffers(hdc);
  }
  //---------------------------------------------------------------------------
  void TForm1::Render()
  {
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  glPushMatrix();
  glTranslatef(-50,0,0);
  glPushMatrix();
  rx1=(-x1+ax); if (rx1>dx) rx1=dx;
  if (rx1dx) rx2=dx;
  if (rx2Execute())
  {
   rgb=ColorDialog1->Color;
   memcpy(color,&rgb,3);
   glDeleteLists(eye,1);
   //-------------------------
  glNewList(eye,GL_COMPILE);
  glColor3f(0.8f,0.8f,0.8f);
  gluSphere(Sphere,46,48,48);
  glColor3f(0.0f,0.0f,0.0f);
  glPushMatrix();
  glTranslatef(0,0,44);
  gluSphere(Sphere,10,20,20);
  glPopMatrix();
  glEnable(GL_BLEND);
  glColor4f((float)color[0]/255.0f,(float)color[1]/255.0f,(float)color[2]/255.0f,0.5f);
  glPushMatrix();
  glTranslatef(0,0,32);
  gluSphere(Sphere,24,32,32);
  glPopMatrix();
  glDisable(GL_BLEND);
  glEndList();
  //------------------
  }
  }
  //---------------------------------------------------------------------------
<<<


: Criogen*
:
: 31.05.2009  05:04
: 3
: 1489
: 0 (0|0|0|0|0) [0]

: C++ Builder
Mir

:
 1-  () Sauron ::: 20.10.2010 | 06:19
Sauron (.18)
: 40487
:
. : 168
: 27.04.2006 (15)
Ant_on92 15.06.2009 | 08:55:

opengl -)


--------------------
.
Ant_on92* ::: 15.06.2009 | 12:55
Ant_on92 (.8)
: 1538
: .
. : 2
: 13.09.2006 (615)
...


--------------------
Hello, World!
 1-  () Key ::: 06.06.2009 | 13:24
  (.1)
:
:
. :
: 13.12.2017 ()
OpenGL... )

?