Version 39 of Tcl3D Discussion

Updated 2009-11-23 21:28:21 by paul

This page is intended for discussion about Tcl3D.


RT notes, 13Jan2006, tclogl has been renamed to tcl3d and now lives at [L1 ]. I installed on win2000 and tried a number of demos successfully. One snag was that the main package require failed on my system due to missing dependent dlls for

    package require tcl3dcg
    package require tcl3dsdl

Fixed by adding the catch wrappers around these two commands. Nice and pretty extensive package!

PO 2006/01/15

If you do not have Cg and SDL installed, either use the patch above or use the Tcl3D-Lite distribution.

I'm currently working on a better way of detecting the availability of dependent libraries.

PO 2006/03/05 Above problem has been resolved. Try new version 0.3.


ramsan: I have been looking at the package (maybe not too deeply), and I did not find any reference to fonts and text. Does the package have any ability to define which fonts to use, font size, print text, encodings and international characters and get sizes info (the width and height that needs a given text in the screen)?

PO 2006/01/16 The Togl widget has built-in support for bitmap fonts, but Togl had problems displaying fonts on Windows, because it relied on Tk internal structures. I'm currently fixing this. A bug-fix release will hopefully be available next weekend. Here is a snapshot of my font test (and selection) tool.

http://www.tcl3d.org/demos/LibrarySpecificDemos/tcl3dTogl/tcl3dFont.jpg

RT 2006/01/16 - I see your font test shows anti-alias for Tk but not for Togl/tcl3d. Will anti-alias be caller-controlled in tcl3d?

PO 2006/03/05 - Antialiasing can be done in Version 0.3, when using the FTGL library. See the demo program ftglDemo.tcl.

ramsan 2006/02/11 - Is the font demo available in the tcl3d distribution? I could not find it in the web page and I could not find any command in the documentation related to font and text handling.

PO 2006/03/05 - It's available in Version 0.3.


I (ChrisL) am trying to get tcl3d built on OS X, but am out of my depth. I've downloaded and built swig in preparation, and made what I believe to be sensible edits to config_Darwin, but now I'm stuck. Has anybody successfully built tcl3d on a Mac?

DAS - I made binaries for Mac OS X Tiger and a diff of OS X changes available at [L2 ] (note that while the tcl3dSDL binary is statically linked with SDL, the tcl3dCg binary requires Cg.framework from nvidia to be installed).

Most of the demos that I tried work ok, except for a few that use features that my old nvidia 4mx card does not support; it would be useful to have some testing by folks with macs with more modern graphics cards...

Also still available at that same location are a patch for the original tclogl 0.1 and binaries for Mac OS X Panther of tclogl 0.1 and the enhanced Togl 1.7 (which built out of the box on OS X]).

ChrisL : I just tried your tcl3d_darwin_0.2.tgz, but had problems:

    Library not loaded: /System/Library/Frameworks/Cg.framework/Cg

which is a framework I don't have. Do I need a different build for my ATi powered Mini? Any chance you could walk me through the build process? I'll investigate further when there isn't a slow VNC link between me and my Mac.

DAS - As mentioned above, you need to download and install Cg.framework from nvidia: [L3 ], this is also explained in the tcl3d Readme... As for the build process, once the patch is applied, just build like on other platforms, as detailed in the tcl3d Readme.

PO 2006/06/19 - Mac OS X versions are available on the Tcl3D home page http://www.tcl3d.org . Thanks to DAS.


Synic 2006-12-24 - The Mac OS X port seems awfully slow on my PPC Mini -- 10x slower than my desktop PC which uses the same video card (ATI Radeon 9200) -- just testing 20 animated flat panes. It flies on Windows and Linux (despite my using the GNU Radeon kernel driver for X11 rather than the proprietory one). Any ideas what might be causing the sluggishness? Would installing this Cg.framework from nVidia do anything to fix it?

Synic 2007-01-22 - Okay, I've learned a bit more. Nope, the Cg.framework probably wouldn't do anything useful for performance. The problem is Mac OS X's drivers for the PPC Mac Mini (which uses the ATI Radeon 9200) don't support hardware acceleration in OpenGL. OpenGL is software rendered. GL_VENDOR=Apple, GL_RENDERER=Generic, GL_VERSION=1.1 Apple-1.1, GLU_VERSION=1.3 MacOSX. The latest drivers direct from www.ati.com don't add hardware acceleration either. Very unimpressed.

PO 2007/02/25 - Please try the new 0.3.2 release. If the graphics context, Togl wants to have, is not supported 100 percent, then the software renderer was choosen. I have changed this behaviour to have hardware accelerated OpenGL in any case. Tested on a MacBook.

Synic 2007-02-26 - Unfortunately, I can't try out the binary release (it's labelled as being for Intel Mac only, mine's PPC). I had a go at compiling from source and got stuck at this part:

 make -C tcl3dSDL all
 g++ -dynamiclib -Wl,-single_module -fno-common -o tcl3dSDL.dylib \
     tcl3dSDL_wrap.o \
     /Library/Frameworks/Tk.framework/libtkstub8.4.a \
     /Library/Frameworks/Tcl.framework/libtclstub8.4.a \
     -L../extlibs/Darwin -lSDL -framework OpenGL -framework AGL \
     -framework ApplicationServices
 /usr/bin/libtool: can't locate file for: -lSDL
 /usr/bin/libtool: file: -lSDL is not an object file (not allowed in a library)

Just in case, I tried port install libsdl libsdl_mixer libsdl_ttf libsdl_soundbut it didn't make any difference.

PO 2007/02/27 - You might try one of the following choices:

1. If you don't need the optional modules (SDL, FTGL, ...), just build the Tcl3D-Basic version. See chapter 2.2 and 2.4 of the manual. You more or less just have to edit the file make.wrap.

2. The libraries for the optional modules are expected to be in folder tcl3d/extlibs/Darwin by default. Otherwise you have to add -framework XXX to macro SYSLIBS in file config_Darwin.


Simple question: The extlibs_win32_0.3.zip includes "The SDL and FTGL DLL's" but there is nothing in the archive or in the manual that says where to put the files. So, where should they go?

Apparently in the system32 directory or any directory contained in your Path variable.

PO 2006/06/19 - The new version 0.3.1 now comes with Starpack versions of Tcl3D, which include all necessary external libraries.


What are the poTcllib and poTklib required by demos/redbook14/StartProgs.tcl?

PO 2006/06/19 - These are my private Tcl and Tk libs. StartProgs.tcl is just a left-over test program used for comparing the C and Tcl versions during development and should not be part of the distribution. Sorry.


IDG Apr 18 2006: One thing not provided by tcl3d is hardcopy output. To provide this, I have wrapped Christophe Guezaine's gl2ps package. Binary extensions for win32, linux32 and linux64 can be found in http://www.sfu.ca/~gay/tclgl2ps.zip .

PO 2006/06/19 - I have included the GL2PS library into the standard Tcl3D distribution starting at version 0.3.1. Thanks, Ian for idea and first implementation.


JBR The download at tcl3d.org does not contain the ODE bindings. Are these released yet?

PO 2007/02/25 - The new release 0.3.2 now includes an ODE wrapper for Windows, Linux, SGI and Mac OS X (Intel based). It still is very alpha, only basic features are wrapped. ODE heavily relies on callbacks. This will be one of the next tasks to do.


PO 2007/04/27 - A bug in release 0.3.2 with left-over bgerror calls in module tcl3dGauges has been found recently.

As this is a Tcl-only module, it's easy to fix:

1. If you don't need this module, just remove the directory tcl3dGauges.

2. Or edit the following files and remove the bgerror procedure:

   airspeed.tcl altimeter.tcl compass.tcl tiltmeter.tcl

PO 2007/06/20 - Problem report

Problem: Build process stops when environment variable DISPLAY is not set or access to DISPLAY is denied.

Synopsis: This is due to the script createStateList.tcl, which converts the ASCII representation of the OpenGL state variables into Tcl package code. The state list is created in a boots-trapping process, which needs to have a valid OpenGL context established. Therefore a Togl window has to be opened and this window needs acess to the DISPLAY.

Workaround: Replace the last line in tcl3dUtil/Makefile:

   $(TCLSH) createStateList.tcl glSpec$(DSEP)glSpec20.txt $@ > glSpec.out

with:

   echo "proc tcl3dGetStateList {} { return {} }" > tcl3dStateList.tcl

Note the tab as first character of the line.

Solution: Bootstrap process will be removed in future Tcl3D version and replaced by a pre-built tcl3dStateList.tcl file.


PO 2007/06/20 - Feature request

There has been a request for Mac OS X universal binaries of Tcl3D. As I am not a specialist with OS X, could somebody jump in here?

Synic 2007-07-14: The docs at http://developer.apple.com/technotes/tn2005/tn2137.html and http://www.gecode.org/gecode-doc-latest/PageComp.html may help with this.


Synic 2007-08-09 - I've just tried the game I'm writing using Tcl3D on Windows 98 (through vmWare). First up, well done: It runs with no errors or bombing! Version 0.3.2 seems to be slow on this platform too, though I'm not sure how much of that is Tcl3D's fault or how much is due to vmWare and/or the OS instance's OpenGL driver support.

Just thought you might like the feedback :-)

PO 2007/08/09 - VmWare does not support 3D acceleration inside a virtual machine (yet). You can see, that it runs without "real" 3D by looking at the bottom line of the screenshot below (GDI generic). I typically start the Tcl3D Starpack inside a Win98 VM before releasing a new version and run some of the demos.

http://www.tcl3d.org/demos/tcl3dExt/tcl3dOnWin98.png

PO 2009/08/22 - For those still interested in Win98 support: Starting with version 0.4.1, the Windows binaries available at the Tcl3D homepage are created with Visual Studio 2005 (due to the new tcl3dOsg module) and do not work on Windows 98 anymore (but work on Windows 7). If compiled with Visual Studio 2003, Tcl3D 0.4.1 still runs on Windows 98.


jamling - 2009-09-09 11:21:33

Jamling 9/9/2009 Color index mode.

I try to use Tcl3D in color index mode. In 'togl' I use the option '-rgba false', then I set the color with the 'glIndex*' command. But, Is there an equivalent command to 'glutSetColor'. How setup the color-lookup table?

PO 2009/09/11 - As stated in chapter 5.2 of the manual, Tcl3D does not support color index mode. As color index mode is a deprecated feature of OpenGL 3.X, there are no plans to implement it in Tcl3D.

Note, that the effects of color index mode might be achieved by the use of 1D texture maps or shaders.


arezey 23/11/2009 22:24: Hey, is it possible to use the selection buffer in Tcl3D? I googled up a tutorial which contains the following code:

    //Calculate select buffer capacity and allocate data if necessary
    int capacity = getObjectCount()*4*getNameStackDepth();      //Each object take in maximium : 4 * name stack depth
    IntBuffer selectBuffer = BufferUtil.newIntBuffer(capacity);

    //Send select buffer to OpenGl and use select mode to track object hits
    gl.glSelectBuffer(selectBuffer.capacity(), selectBuffer);
    gl.glRenderMode(GL.GL_SELECT);

The code - especially the newIntBuffer part - seems like something not available in Tcl (though I only can code the hello world program in C so I don't know), any other way to get the capacity? Or other workarounds to get the selection? It's quite critical to a project I'm cooking here...

The only other way I can see would be to go through all the polygons which would include the cursor coordinates (though I don't know how to check if a point is inside a triangle or a quad) and check what's nearest. That's a last resort to me though..


PO 2009/11/23

Typing glSelectBuffer in the search field at http://www.tcl3d.org/html/demos.html finds 3 Tcl3D demos from the OpenGL RedBook using that command.

Integer arrays usable for glSelectBuffer can be created like this:

    set selectBuffer [tcl3dVector GLuint 512]