Nov/084
V0.65 – Shadows in 3D!
Made a great lot of very usefull changes in this version. First and most basic being the addition of line and dot primitives in the rewritten frame loop. This allows for some really cool stuff you will see soon (3D graphs!). And the rewriting of the frame loop added a lot more possibilities for the future as well, with respect to light, shadows and glows. Checkout a realtime demo of the action after the read link.

A demo of the AS3 3D Engine doing shadows, realtime demo after the read link.
Bugfixes:
- Changed the frame loop to accept non-polygonal 3D objects (like lines and dots) in a better way.
Known bugs:
- Not all rotation and translation functions for objects, rotate the vector normals and/or translate the object midpoints yet.
- Sometimes undefined shadow faces are added to mShadowFaces, the error is now catched but still visible from time to time.
- Some polygons are still incorrectly culled, have discovered the issue though.
- Problem in the Z-buffering effecting relatively big differences in face sizes.
- Cone shadows are incorrect.
New features:
- Line primitive
- Dot primitive (currently the size is not effected by distance)
- Cull parameter for faces that should not be culled (planes for example)
- Added object rotation, surface normals not yet rotating perfectly.
- View frustum culling (very basic, still some work to be done)
- Shadows
Upcoming features:
- Textfields at 3D points
- Performance increase
- Object/face glow
- Directional light and light with different colours
- Roll camera movement
- Texture perspective correction
- Multiple cameras
- Reflections!
- 2D primitives; planes, circles, etc.
But before the next big changes I will probably upload a few nice examples of the 3D engine at work (games and graphing!). And if someone can help me understand the FLARtoolkit, we might see some augmented reality with this 3D engine in flash as well! The source will be released when I feel the engine is stable enough to be released, check out earlier posts for credits to classes used with the 3D engine.
Sorry, the comment form is closed at this time.
No trackbacks yet.
6:19 am on December 29th, 2009
Hey man, great stuff you have got here, I am writing my own 3d enviroment as well. How did you project this shadows on the surface? any tips would be helpful.
Cheers
5:09 am on January 3rd, 2010
Hi I have a question, how does your code calculate this shadows and cast on to the other object, as I have searched through net and this is quite hard stuff to find. Even if I calculate vectors from light source through each corner vertex, then there is another problem to calculate intersection point of this vector with the face of object which is receiving the shadow.
Is it possible you could post some tips how you have done it?
1:45 pm on January 31st, 2010
I’m sorry I haven’t had time to reply to your question earlier on. As far as I remember, the shadows edges are formed by tracing lines along edges of the objects onto the surface. Than made a lot of triangles with the objects center forming all the triangles tops.. So I might have directed the calculated triangles directly to the polygon rendering function. There was a neat method for finding the objects edges which I don’t remember probably had to do something with comparing surface normal’s to the relative light’s position vector. If I find time I’ll look into it and find you a better explanation.
8:26 pm on February 1st, 2010
I know about tracing lines from light through points on object, but how do you find out x,y,z point in space at which this line intersects with ground plane ???