I just uploaded the OBJs-Shadows-Picking.zip file. Unsurprisingly,
it's a sort of testing/example app for loading OBJ files, shadow
mapping, and the picking of 3D objects. It works well, but I need some
help in fixing a few issues with the shadow mapping.

Here's more information. This project has three main components:

1.The OBJ-loading code by Alex Holkner (revision 1884). OBJ is a
common file format for 3D objects, exported by Blender and other
modeling apps. I modified the code very slightly (see the notes in
obj.py). In this app, a loaded obj becomes one of the attributes of my
simple Object3D class, which has other attributes such as position,
velocity, and visibility. Object3D also has a method for updating the
position, rotation, etc. based on an elapsed time interval.

2.Picking code that translates screen (mouse) coordinates into 3D
world coordinates to identify which 3D object was selected/picked/
clicked by those coordinates. The technique relies on setting the
picking_id attribute of each Object3D when the objects are "drawn" via
the picking code. Works great. In window.py, see:
 - pick_object_at_point()
 - draw_objects()
 - object_with_picking_id()

3.Shadow mapping. It works, but the code is at the limit of my OpenGL
understanding and has some problems which, I'm hoping, are easily
fixable by others more experienced that I.

Problems I need help with:
- Shadow-casting Object3Ds don't self-shadow or cast shadows on other
Object3Ds. In the window.on_draw() method, there is a small section
labeled "Third Pass" where the drawing of the Object3Ds is commented
out. If uncommented, those objects appear too dark, as if they are
permanently in shadow. I am stumped.

- If the SHADOW_MAP_SIZE constant (in shadows.py) is larger than the
window size, a moire pattern and/or other glitches appear. Increasing
the shadow map size is one easy way to increase the sharpness of the
shadows, so it would be create to find a solution. Any ideas?

- If antialiasing is set to True in window __init__, the frame rate on
a MacBook Pro plummets to about 2 fps. A long time ago, I made an
Objective-C version of the shadow mapping code which had the same
problem. I tried to find an answer in an Apple discussion group, but
was in over my head and never got it resolved. It seemed to come down
to the performance of gCopyTexSubImage2D when antialiasing is on.
Here's that thread in the hopes it might help (or will it confuse?):
http://lists.apple.com/archives/mac-opengl/2008/Feb/msg00001.html
I will give a laurel and hearty handshake to the person who solves
this issue (ahhh, Blazing Saddles...)

I also included a less-important fourth component: my humble attempt
to create Checkbox and Slider controls. Both are subclasses of the
Control class.

Any help is much appreciated.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to