![]() |
||
| Home | SwiftForth Archive | SwiftX Archive | |

Roger,
Right now, it is just a simple system. While I do plan on extending it to=
support a few more things, right now it does none of that.
SFGL does the following:
o Ability to quickly bring up an OpenGL Window
o Pass floating point and double values to OpenGL DLL
o Control and render a complete entity system
o 1 simple, directional light (at the camera)
o A few built-in primitives to use (like cube, sphere, etc.)
o Picking entities with the mouse
Texture mapping, 3D model loading, etc. are all certainly possible, thoug=
h,
the way SFGL is set up. Let me explain:
Everything rendered is done through a subclass of Entity3D, which has a
defered function: DRAW, which is called by the engine each frame. In this=
, you
can use any and all OpenGL routines to construct your object. For example=
(a
simple quad):
Entity3D SUBCLASS MyQuad
: DRAW ( -- )
GL_QUADS :: glBegin
-1e -1e 0e 3sfparms glVertex3f
1e -1e 0e 3sfparms glVertex3f
1e 1e 0e 3sfparms glVertex3f
-1e 1e 0e 3sfparms glVertex3f
:: glEnd ;
END-CLASS
As you can see, you could do texture mapping, etc. inside the DRAW functi=
on.
Now you can create a new quad and add it to the "world" with very little =
code,
too:
MyQuad BUILDS quad
quad SFGL-WORLD ADD-ENTITY
That's it. It will now be rendered each frame of animation. There are als=
o
functions for controlling each entity:
Entity3D -> STRAFE ( x -- )
Entity3D -> ELEVATE ( y -- )
Entity3D -> MOVEFORWARD ( z -- )
Entity3D -> Pitch ( degrees -- )
Entity3D -> Yaw ( degrees -- )
Entity3D -> Roll ( degrees -- )
Among others. You can also add limbs (using ADD-ENTITY) to any object. So=
if
you add a sphere as a limb of your quad, above, then as you rotate the qu=
ad,
the sphere will rotate around it, etc.
That's about it right now. There are a few things I'm trying to work arou=
nd in
SwiftForth to make some things work, but overall I think it is a good sys=
tem.
I'll probably start back up on it in 2-4 weeks and throw up some sample c=
ode
on my website.
Jeff
----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Fri Nov 07 2003 - 16:06:23 PST
This archive was generated by hypermail 2.2.0 : Tue Dec 02 2008 - 03:04:34 PST