|© 2000 Edward Patel||Stockholm, 27 March 2000|
|*NOTE* This should not be mistaken for the TinyGL library made by Fabrice Bellard (found here) that might also work on the PalmOS, if someone will do the port.|
tinyGL is a *very* tiny 3D modeling software for the PalmOS. Can it be smaller and still be useful? or is this really useful? Who knows?
I have done this mostly for fun, but also because I really like the Palm and do work with *real* 3D applications. I've been missing some useful 3D thing on the Palm, like a quick-n-dirty-tiny-3D-modeling thing, that one might have along in the Palm anywhere, like the beach. No one else seem crazy enough to do it so I might have a go at it and this is now my second distribution. Due to the fact that I have spent some time on this project I have now made it a shareware version.
The Palm isn't really designed to do stuff like this but if one just sticks to the basics it might just work, at least to be fun. Don't expect to do large landscape models with tinyGL, on the tops one might make a model with around a houndred vertexes. Nurbs and Particule system will maybe come in future version when the hardware will allow for it ;o) GUI design is for me a theory of making things invisible, like all good things are, things are there when one needs them. For now I have tried to have a balance between memory limitations, calculation speed and drawing speed. I think I have done some good choices so far.
The first version was just for testing the concept and working with the UI that is *very* tiny. In this second distribution I have added several new features like multiple models, export, undo and an off-host viewer. I have also worked on the method for doing exporting as plugins, not trivial but at least possible (it would even be possible to generate OpenFlight files).
It is basically built in five parts. First a fix-number library (API) to do fast math. Second a 3D library (API), like a tiny version of OpenGL with just the things I need for this (the header file can be found here). The third is this little 3D modeling creating thing. Fourth the plugin method for exporting and fifth the off-host viewer.
Are you interested in doing 3D programming on the Palm? Take a look at miniGL, an effort to port the OpenGL API to Palm. If you want to learn more about 3D graphics and real-time rendering please look here.
The user interface for tinyGL is not a feast of features but rather a tiny selection of things to do fiddling around with a model trying to be creative. The UI is also not a traditional Palm UI.
Just for fun (like most of tinyGL is done) I have put in a left-handed option. But for this short description I will be writing as if this option is set to off.
In this second version I have added two normal menus.
Most menu items are self explained I guess, but Export... and Model info... might just need a short introduction. Export... will bring up a small dialog where one can choose an export method. The export methods are plugins (code resources) that communicates with the tiny off-host viewer. Model info... will display the name and statistics, number of strips etc, of the model. Under Preferences... one can choose a Grid option, a Left handed option, and an option to display/hide the origo axis.
I have placed a couple of menus in the four corners. These reflects the different states the UI can be in. One interacts with the UI by taping with the pen on different words and by taping and dragging in the view.
In the upper right corner there are two menus. The top one reflects four different viewing modes. PERSP, for perspective viewing (this mode has no editing possibilities). FRONT, for an orthogonal view from Z. SIDE, for an orthogonal view along X. ABOVE, for an orthogonal view from Y.
The menu below reflects four view modifiers and strip/vertex moving features. PAN, for translating (panning) the view. ROT, for rotating the view in PERSP. ADD, for inserting new vertexes in a triangle strip. MOVE, for moving a whole strip or individual vertexes. TRIM, is for moving individual vertexes without having to tap SELECT. These modes can be changes by changing view states or other events so it is important that one keeps an eye on these to identify which mode is active.
On the right side is a small circle that can be dragged up and down. This is used for zooming in and out.
In the upper left corner are menus for working with a triangle strip. Triangle strips are the basic building element in tinyGL. A triangle strip is an efficient way of specifying a set of triangles for 3D graphics system. If you do not know anything about this and still want to use tinyGL please read about this some where else because I feel that this is beyond the scope of my work. The top menu item says either ADD or NEXT, this can be a bit confusing because each tap on this will select the NEXT strip in the model. At one place (when one has come to the begining of the set of strips) will ADD be active. If one now selects a viewing mode other than PERSP and then ADD below PERSP one is able to insert a new vertex in a new triangle strip. When NEXT is active will ADD and DO be visible below. By selecting (and activating) ADD will the last edge be visible and showing the last two vertexes in the strip and where the next triangle can be added. At the same time will ADD in the view modifiers be available. Then taping on and holding down the pen on DO will bring up a small menu with a small set of editing features. The first is a HIDE/SHOW toggle that can be used for making parts of the model invisible during editing on other parts.
WALL, is for making a wall from the contour of the current triangle strip. The menu will be visible and the WALL will be selected until one tap in the editing view. Keep the pen down and move the newly created rim of the wall. As an exercise try to make a circle in the FRONT view, change to SIDE, select WALL and drag out to the right for making a pipe.
MOVE ORIGO, is for moving the origo to define the center when doing a SCALE, ROTATE or MIRROR. As for WALL will the menu be visible and the function (except MIRROR) be selected until one tap in the editing view. By dragging up/down one changes the angle of rotation. Scaling can be done either in 2D or 3D, the 2D will be scaling in the current viewing plane and with freedom in both height and width. The 3D form is a uniform scaling in all 3 dimensions by dragging up/down.
The mirroring will create a copy of the selected strip and mirror it in either LR (left-right) or UD (up-down) from the current viewing plane.
COPY makes a copy of a strip.
When NEXT is selected will SELECT be available top center in the window. This is for selecting (picking) vertexes directly. Note that selecting a vertex when a vertex is already selected and MOVE is active will move the vertex to this picked vertex. Selecting a vertex when ADD is active will insert a new vertex in the current strip with this picked vertex coordinates. In the lower right corner will DEL be visible when NEXT is active. With this one can delete a triangle strips last vertex if it is selected. If no vertex is selected will the whole strip be deleted. In the lower left corner is REND visible. By taping on this will render the view with a quick-n-dirty shading. When one has done a MOVE will UNDO be visible above REND. This is for undoing a move that went bad or was done by mistake.
This was just a short quick-start. The creative part you have to supply yourself. Good practice like when to use wall and mirror ie. one has to practice.
The tinyGL Viewer is a small Win32 application based on OpenGL. I have implemented it with GLUT so I might port it to Mac and Linux in the future (or maybe someone else). The viewer is listening on the serial port for information sent from tinyGL. It uses COM1 as the default port but it is possible to use another by specifying it at startup of the viewer. (Remember to disable HotSync before starting tglv.exe, otherwise has HotSync reserved the serial port)
The communication between the viewer and tinyGL is not handshaken. On slow machines this could be a problem but I haven't had any problems myself so far.
Requirements for the viewer are Windows9x/NT, OpenGL and GLUT. For .dlls see http://www.opengl.org/Downloads/Downloads.html
tinyGL can either send a model for viewing or generate a file. The generated files will be created in the "Exports" directory. For example code see the tGL_ex.zip, toVRML.zip, toOpenGL.zip and toDXF.zip contained in the distribution. The toVRML.zip contains the source code for the plugin that was used for exporting this model. toOpenGL.zip contains the source for a plugin that generates a "C" file with OpenGL calls. toDXF.zip contains the source for the plugin that exports the 3D model to a DXF file.
tinyGL 3D modeling software for Palm
Copyright (C) 2000 Edward Patel, All rights reserved.
This software may be freely distributed subject to, but not limited to, the following terms: This software may not be sold or resold, distributed as a part of any commercial package, used in a commercial environment, used or distributed in support of a commercial service, or used or distributed to support any kind of profit-generating activity, even if it is being distributed freely.
If you would like to distribute this software as part of a shareware distribution, magazine, book, CD-ROM, etc. please contact the Author for permission.
All commercial use interests in this software should be directed to the Author, too.
THE AUTHOR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. THE AUTHOR SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY ANYBODY AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.