GLScene/zh CN

From Lazarus wiki
Revision as of 07:54, 18 March 2014 by Wangyouworld (talk | contribs) (GLScene/zh CN)

Deutsch (de) English (en) français (fr) Bahasa Indonesia (id) 日本語 (ja) 한국어 (ko) português (pt) русский (ru) 中文(中国大陆)‎ (zh_CN)


GLScene是一个基于OpenGL的3D库。它最初是为Delphi编写的,现在它可以工作C+ + Builder、Kylix、Delphi和Lazarus中。



  • hierarchical objects structure, with as many objects as memory allows, easily extendable
  • 互动场景管理(许多 Delphi 专家)
  • 易于使用的对象旋转、运动功能。
  • 预定义的对象(立方到茶壶、雪碧等),易于扩展
  • structural objects (dummy cube, proxy object) for manageing composite objects
  • procedural objects (heightfield, revolution solids, pipes, tesselators...)
  • support for 2D and 1D objects (sprites, lines with spline support) fully integrated
  • HUD objects (sprites rendered in 2D coordinates)
  • Utility objects (grids, skydome, arrows...)
  • support classes for directly accessing OpenGL
  • camera and light objects that can be used anywhere in a scene objects hierarchy
  • behaviour objects can be attached to objects for animation purposes, easily extendable
  • per-object special effects (before/after object rendering and scene after-effects), easily *extendable
  • support for particle systems, any object or object structure can be a particle
  • 3D Studio file import with automatic and precise normal vector calculation (using the given *smoothing groups of the file) and texture coordinate import
  • Other imported formats : OBJ/OBJF, SMD, MD2, STL, TIN, PLY


  • easy to use, optimized, material object
  • material library to share and reuse materials
  • ambient, diffuse, emission, specular and shininess support
  • support of blending modes (transparency, additive...)
  • alpha-channel auto-generation
  • support for OpenGL texture formats, including compressed ones (DXT, S3TC etc.)
  • generic plug-in shaders support
  • High-level Cg shaders support classes
  • polymorphic image support for texturing (allows many formats as well as procedural textures), easily extendable
  • more than 150 predefined colors like clrCornflowerBlue or clrCoolCopper (easily extendable) *in addition to standard colors and direct RGBA specifications
  • easily to use texture movement and scaling properties, independently from texture coordinates
  • 32 bits Bitmap support class


  • automatically uses the hardware OpenGL driver if available
  • a well working camera model using focal length and targeting
  • multiple viewers for one or more scenes, easy change of view through camera selection
  • fog and depth-of-view support
  • render to a file, a bitmap or to the printer in any color and pixel resolution
  • full screen support with dynamic resolution changes
  • reflections and mirror effects
  • dynamic shadow casting
  • high-performance scene-wide transparent particles system support
  • automatic frustrum culling (hierarchical or per-object)


  • propagation of time progression events
  • 骨骼动画(每个顶点多个骨骼)
  • frame interpolation and morph targets
  • 易于行为扩展
  • 动态物理:惯性,加速度,阻力中的应用
  • automatic, realtime scene cadenceing


  • 易于使用的功能方便拾取对象
  • 摄像机运动辅助函数
  • 拾取对象平移辅助函数
  • 用于屏幕和世界坐标系之间的转换,光线投射


  • optimized geometry functions and utilities (vector, quaternion and matrix...)
  • cubic spline support functions and class
  • mesh manipulation and optimization (stripification, vertex-cache awareness, etc.)
  • component to make full-featured screen-saver in a few clicks
  • precise frame speed determination
  • 异步定时器(多线程)
  • 操纵杆支持
  • 异步键盘接入,支持键盘映射


Gl effect.jpg Gl cel.jpg Gl trinity.jpg
Gl ode.jpg


作者: initially Mike Lischke 这段时间由 Eric Grange维护 LCL 接口: Christian Ulrich



一个大的更新(截止 2012-05-03)GLScene在

最新 (v1.0.0.2)

This should be almost identical to the original cvs repository of today in terms of functionality and bugfixes, however, there are still some parts missing. There wont be a "Lazarus-with-GLScene-Installer" with this new release, unless someone else creates it. --Crossbuilder 20:16, 18 July 2007 (CEST)


An older release (version can be found on the Lazarus CCR Files page together with a lazarus installer with GLScene already in the Lazarus IDE and GLScene demoes. UPDATE: This is pretty old now. If possible, use the svn checkout (see below).




svn co glscene


你Windows你可以使用tortoise SVN或其它工具。


Bug反馈/功能要求 请选择"Lazarus-ccr"项目中的"glscene"分类,感谢。


  • 18.07.2007 快照发布版本
    • 调整了些东西,它能工作在最新的lazarus SVN版本
    • 添加位图对象到SceneEditor
    • 修正SceneEditor中另一个AV
    • incorporated all patches and bugfixes from original glscene cvs repo like dynamic textures ..
  • 13.06.2007 快照发布版本
    • incorporated all patches and bugfixes from original glscene cvs repo
    • improved scene editor (crashes less, but still needs some love)
      Tip: Save your project frequently ;-)
    • seperated mmsystem dependent stuff from generic sound support so e.g. FMOD is available in linux, too
    • 更多 ..
  • 01.12.06 Added support for ODE, gtk2 and Cg shaders in Linux (ODE is limited to normal release, unsupported are cone, ccylinder and terrains)
  • 10.08.05 Too many changes to post here see cvs history
  • 16.07.05 GLScene 0.9.X Port
  • 查看GLScene SourceForge帐户的完整日志

状态: Beta


需要FPC 2.1.4或更高版本,及lazarus0.9.23以上。11348或更高 !!

  • 提取源文件
    • ZIP:
      • 在 "lazarus/components/" 下执行 "unzip",这将创建 lazarus/components/glscene/ 文件夹
    • SVN:
      • 在 "lazarus/components/" 下执行
        svn co glscene
        ,这将创建 lazarus/componets/glscene/ 文件夹
      • Tortoise SVN: 手动在lazarus/components/下创建文件夹 "glscene", 右击文件夹的空白处选择TortoiseSVN下的 "SVN Checkout(检出)...",在 "URL of repository(版本库URL)"中添加
  • 完成安装:
    • 复制 "lazarus/components/glscene/globallinks/*.lpl" 到 "lazarus/packager/globallinks/"
    • 打开 lazarus
    • 在"包"菜单下选择 "配置已经安装的包 ..."
    • 在 "Available packages(可用的软件包)" 中选择 "glscenelazarus"
    • 点击 "安装所选" 按钮
    • 点击 "保存并重建IDE" 按钮
      • 注意:有可能会出现"jpegforlazarus"未找到的错误。如果是的话,你可以执行以下操作:
      • 包菜单 --> 打开包文件...
      • 选择 "glscenelazarus" (版本 后点击 "打开..."
      • 在"Required Packages(所需的软件包)"列表中移除"jpegfromlazarus"
      • 查看"jpeg"单元,在/lazarus/components/glscene/Source/base,替换"LazJPEG"(在uses部分)为"LazJPG"(ImagesForLazarus包)
      • Save and repeat last 4 steps again.
      • 提示:你应该安装了"ImagesForLazarus"包,如果没有,操作方式和安装"glscenelazarus"类似。
    • repeat the last 4 steps for the other packages you want to use.
      • Note: glsceneode and glscenecgshader need their respective libs on the system during installation!
    • Note: you can also try to select and install all packages in one go. However, I prefer to do things step by step, so I see where it fails, if it fails ;)
    • Install "glscenelazarus" - mistakes: (only needed when using, in svn these are already fixed)
      • To correct the unit GLLCLViewer: procedure TGLSceneViewer.CreateParams(var Params: TCreateParams); - at procedure TGLSceneViewerLCL.CreateParams(var Params: TCreateParams);
      • To correct the unit GLLCLViewer: procedure TGLSceneViewer.EraseBackground(DC: HDC); - at procedure TGLSceneViewerLCL.EraseBackground(DC: HDC);
      • To correct the unit GLLCLFullscreenViewer: Change "RegisterClasses([TGLSceneViewer, TGLFullScreenViewer]);" to "RegisterClasses([TGLFullScreenViewer]);"
  • 软件包列表:
    • glscenelazarus 主要包
    • glscenecgshader Cg 渲染组件
    • glsceneode ODE 组件
    • glss_fmodlaz FMOD 组件
    • gls_winonly 仅Windows,包含声音支持mmsystem,BASS支持和GLScreenSaver组件
  • Сompilation "demo" - mistakes:
    • If not found class - TGLSceneViewer: To correct the uses (demo): GLLCLViewer - at GLViewer


  • 创建目录 lazarus\components\GLScene
  • 在目录中解压zip文件
  • 打开 lazarus
  • Open the package glscenelazarus.lpk with Component/Open package file (.lpk) from lazarus\components\glscene\Lazarus
  • (Click on Compile is only necessary, if you don't want to install the component into the IDE)
  • Click on Install
  • Repeat these steps (open .lpk, click install) for the other packages you want to use. Note: these additional packages need additional libs (fmod, ode, Cg).
    • glscenecgshader.lpk : Cg shaders (only with NVidia cards?)
    • glsceneode.lpk : support for ode lib
    • glsss_fmodlaz.lpk : support for fmod lib
    • gls_winonly.lpk : this can be installed on windows only. Contains screensaver stuff as well as support for BASS lib.

Hint: sometimes an Error "GLGraphics not found" occurs. Don't worry, just do Tools->Build Lazarus again and it should be ok.

A full install of Lazarus with GLScene already in the IDE is available as 二进制Win32发布

Just a warning for (new) Linux users: GLScene in its current state is not working "out of the box" (lots of modifications/additions needed). UPDATE: this is not true anymore. glscene for lazarus is pretty up-to-date and most things work good right out of the box for windows as well as for linux.

As of latest trunk version (see svn above) the linux version is working well. Some demos (about 20%) are still broken but the majority of glscene is now working. We're also moving towards making it work in other Unix platforms like FreeBSD.

The missing/nonworking parts on non-windows are: glKeyboard (uses winapi, but is not required mostly), glSound(which uses mm, we need to use openal or somesuch)

一个 全功能的Windows安装程序 计划。


  • 可以在 GLScene 首页 找到
  • 联系 #glscene channel at