Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2005.08.14;
Скачать: CL | DM;

Вниз

OpenGL графика в проектах Delphi (книга)   Найти похожие ветки 

 
-virus- ©   (2005-07-23 16:19) [0]

Преобрел я значит эту книгу и первым делом стал просматривать дискету с проектами. И при компиляции многих программ возникает одна и таже ошибка:

...
procedure glutSolidSphere(
 Radius : GLdouble;
 Slices : GLint;  //здесь ошибка
 Stacks : GLint);
...

Пишет- [Fatal Error]DGLUT.pas: Line too long (more than 1023 characters)

Не подскажите в чем проблема? Или мне стоило начать с книги))(мож там чтото есть по этому вопросу).


 
jack128 ©   (2005-07-23 16:49) [1]

встань на эту строку и нажми end. может где то опечатка или еще что...


 
ferr ©   (2005-07-23 22:01) [2]

{ DGLUT.PAS }

{
 Okulov Rostislav a.k.a Sniper
 ogldelphi@mail.ru
=========================================

01 july 2003
fixed : delphi 6-7  "1023 error"

8 aug  2002
added : texture mapping for glutSolidCube
}

{ Bob Crawford
 F.L.A.S.K.  June, 1997 }
{ DGLUT is an Object Pascal translation of a small part of Mark Kilgard"s  GLUT library for OpenGL.
Included here are just the shape-drawing routines
 from glut_shapes.c and the teapot routines
from glut_teapot.c. Following
 is the original copyright notices from those files. }
{ Copyright (c) Mark J. Kilgard, 1994./**

(c) Copyright 1993, Silicon Graphics, Inc.
}

unit DGlut;

interface

uses
 OpenGL;type
 TGLfloat3v =
   array[0..2] of GLfloat;
 TInteger3v =
   array[0..2] of Integer;

const
 BoxPoints :
   Array[0..5, 0..2] of GLfloat =
     ( (-1,  0,  0),
       ( 0,  1,  0),
       ( 1,  0,  0),
       ( 0, -1,  0),
       ( 0,  0,  1),
       ( 0,  0, -1) );

 BoxFaces :
   Array[0..5, 0..3] of GLint =
     ( (0, 1, 2, 3),
       (3, 2, 6, 7),
       (7, 6, 5, 4),
       (4, 5, 1, 0),
       (5, 6, 2, 1),
       (7, 4, 0, 3) );

 { Octahedron data:
     The octahedron produced is centered at the origin and has radius 1.0 }
 OctData :
   Array[0..5] of TGLfloat3v =
     ( (1.0, 0.0, 0.0),
       (-1.0, 0.0, 0.0),
       (0.0, 1.0, 0.0),
       (0.0, -1.0, 0.0),
       (0.0, 0.0, 1.0),
       (0.0, 0.0, -1.0) );

 OctIndex :
   Array[0..7] of TInteger3v =
     (  (0, 4, 2),
        (1, 2, 4),
        (0, 3, 4),
        (1, 4, 3),
        (0, 2, 5),
        (1, 5, 2),
        (0, 5, 3),
        (1, 3, 5) );

 { Icosahedron data:
     These numbers are rigged to make an icosahedron of radius 1.0 }  IcoX = 0.525731112119133606;
 IcoZ = 0.850650808352039932;

 IcoData :
   Array[0..11] of TGLfloat3v =
     ( (-IcoX,     0,  IcoZ),
       ( IcoX,     0,  IcoZ),
       (-IcoX,     0, -IcoZ),
       ( IcoX,     0, -IcoZ),
       (    0,  IcoZ,  IcoX),
       (    0,  IcoZ, -IcoX),
       (    0, -IcoZ,  IcoX),
       (    0, -IcoZ, -IcoX),
       ( IcoZ,  IcoX,     0),
       (-IcoZ,  IcoX,     0),
       ( IcoZ, -IcoX,     0),
       (-IcoZ, -IcoX,     0) );

 IcoIndex :
   Array[0..19] of TInteger3v =
     ( (0, 4, 1),
       (0, 9, 4),
       (9, 5, 4),
       (4, 5, 8),
       (4, 8, 1),
       (8, 10, 1),
       (8, 3, 10),
       (5, 3, 8),
       (5, 2, 3),
       (2, 7, 3),
       (7, 10, 3),
       (7, 6, 10),
       (7, 11, 6),
       (11, 0, 6),
       (0, 1, 6),
       (6, 1, 10),
       (9, 0, 11),
       (9, 11, 2),
       (9, 2, 5),
       (7, 2, 11) );

 { Tetrahedron data }  TetT = 1.73205080756887729;

 TetData :
   Array[0..3] of TGLfloat3v =
     ( ( TetT,  TetT,  TetT),
       ( TetT, -TetT, -TetT),
       (-TetT,  TetT, -TetT),
       (-TetT, -TetT,  TetT) );

 TetIndex :
   Array[0..3] of TInteger3v =
     (  (0, 1, 3),
        (2, 1, 0),
        (3, 2, 0),
        (1, 2, 3)  );

{ Teapot stuff }

 { Rim, body, lid, and bottom data must be reflected in x
  and y; handle and spout data across the y axis only. }

 PatchData :
   Array[0..9, 0..15] of GLint =
   (
     { Rim }
     (102, 103, 104, 105,   4,   5,   6,   7,
        8,   9,  10,  11,  12,  13,  14,  15),
     { Body }
     ( 12,  13,  14,  15,  16,  17,  18,  19,
       20,  21,  22,  23,  24,  25,  26,  27),
     ( 24,  25,  26,  27,  29,  30,  31,  32,
       33,  34,  35,  36,  37,  38,  39,  40),
     { Lid *}
     ( 96,  96,  96,  96,  97,  98,  99, 100,
      101, 101, 101, 101,   0,   1,   2,   3),
     (  0,   1,   2,   3, 106, 107, 108, 109,
      110, 111, 112, 113, 114, 115, 116, 117),
     { Bottom }
     (118, 118, 118, 118, 124, 122, 119, 121,
      123, 126, 125, 120,  40,  39,  38,  37),
     { Handle }
     ( 41,  42,  43,  44,  45,  46,  47,  48,
       49,  50,  51,  52,  53,  54,  55,  56),
     ( 53,  54,  55,  56,  57,  58,  59,  60,
       61,  62,  63,  64,  28,  65,  66,  67),
     { Spout }
     ( 68,  69,  70,  71,  72,  73,  74,  75,
       76,  77,  78,  79,  80,  81,  82,  83),
     ( 80,  81,  82,  83,  84,  85,  86,  87,
       88,  89,  90,  91,  92,  93,  94,  95) );

 TeaData :
   Array[0..126, 0..2] of GLfloat =
   ( (   0.2,       0,     2.7),
     (   0.2,  -0.112,     2.7),
     ( 0.112,    -0.2,     2.7),
     (     0,    -0.2,     2.7),
     (1.3375,       0, 2.53125),
     (1.3375,  -0.749, 2.53125),
     ( 0.749, -1.3375, 2.53125),
     (     0, -1.3375, 2.53125),
     (1.4375,       0, 2.53125),
     (1.4375,  -0.805, 2.53125),
     ( 0.805, -1.4375, 2.53125),
     (     0, -1.4375, 2.53125),
     (   1.5,       0,     2.4),
     (   1.5,   -0.84,     2.4),
     (  0.84,    -1.5,     2.4),
     (     0,    -1.5,     2.4),
     (  1.75,       0,   1.875),
     (  1.75,   -0.98,   1.875),
     (  0.98,   -1.75,   1.875),
     (     0,   -1.75,   1.875),
     (     2,       0,    1.35),
     (     2,   -1.12,    1.35),
     (  1.12,      -2,    1.35),
     (     0,      -2,    1.35),
     (     2,       0,     0.9),
     (     2,   -1.12,     0.9),
     (  1.12,      -2,     0.9),
     (     0,      -2,     0.9),
     (    -2,       0,     0.9),
     (     2,       0,    0.45),
     (     2,   -1.12,    0.45),
     (  1.12,      -2,    0.45),
     (     0,      -2,    0.45),
     (   1.5,       0,   0.225),
     (   1.5,   -0.84,   0.225),
     (  0.84,    -1.5,   0.225),
     (     0,    -1.5,   0.225),
     (   1.5,       0,    0.15),
     (   1.5,   -0.84,    0.15),
     (  0.84,    -1.5,    0.15),
     (     0,    -1.5,    0.15),
     (  -1.6,       0,   2.025),
     (  -1.6,    -0.3,   2.025),
     (  -1.5,    -0.3,    2.25),
     (  -1.5,       0,    2.25),
     (  -2.3,       0,   2.025),
     (  -2.3,    -0.3,   2.025),


 
ferr ©   (2005-07-23 22:06) [3]

Отправил по почте.


 
-virus- ©   (2005-07-24 13:16) [4]

Спасибо большое! Теперь все работает.
Но всеже, в чем была проблема?



Страницы: 1 вся ветка

Текущий архив: 2005.08.14;
Скачать: CL | DM;

Наверх




Память: 0.49 MB
Время: 0.025 c
1-1122033841
Weberd
2005-07-22 16:04
2005.08.14
Являются ли .dcu файлы версионными?


11-1105023075
Boguslaw
2005-01-06 17:51
2005.08.14
How to pass string from TKOLThread to KOL form ?


1-1122008024
serega78
2005-07-22 08:53
2005.08.14
Как отловить событие Close [x] на форме?


4-1118152251
Олежек
2005-06-07 17:50
2005.08.14
Как пользоваться функцией GetFileSize


14-1122024136
asdqwer
2005-07-22 13:22
2005.08.14
SMS Email Gateway