Yet another 3D Lite Engine
Aucun commentaire
I will put online during the summer a first release of the library Tweened. It contains components, behaviors, a Tween wrapper (facilitating the creation of animation by code) and a mini 3D engine very simple to use. Here is a concrete example that can be downloaded here :
I made this engine primarily for personal needs and to remind me math projective. Reinventing the wheel a some times can be good. The idea is mainly to provide a dll under 40kb, which allows conception of 3D interfaces. This will be useful for designers across Blend or Visual Studio using C #. It will contain in a short time all the basic functions wich are really useful and we do not currently have when using Blend: 3D Camera, 3D Container, 3D scene, detection of normal and smart z sorting (smart and more efficient than currently proposed in Blend) . I added a utility class to facilitate the use of mathematical projective (in progress).
The library contains :
1. A container typed Scene3D (inherited from Panel).
All objects wich are contained within get their projection property locked. Instead of use it, they can use attached dependency properties :
* Scene3D.LocalOffsetX
* Scene3D.LocalOffsetY
* Scene3D.LocalOffsetZ
* Scene3D.GlobalOffsetX
* Scene3D.GlobalOffsetY
* Scene3D.GlobalOffsetZ
* Scene3D.RotationX
* Scene3D.RotationY
* Scene3D.RotationZ
They are associated with an instance of type Element3D. This is recoverable (StartUp event when the 3d scene is broadcast) with an extension method added to instances of UIElement (GetElement3D).
2. A camera linked to the container Scene3D. It offers the following properties:
* FieldOfView
* NearPlane
* FarPlane
* Vanishing Point (XVanishingPoint, YVanishingPoint)
* Displacement (OffsetXCamera, OffsetYCamera, OffsetZCamera)
* Rotation (RotateXCamera, RotateYCamera, RotateZCamera)
Detecting the change of direction of normal (Backface culling) and the scalar product via events NormalDirectionChanged and DotProductChanged. These events are broadcast by instances of Element3D.
I am currently finishing a sorting algorithm depths. This engine should be fairly optimized because its rendering does not rely on a DispatcherTimer. Well, it is rather rendering pipeline optimized because it is not recursive by default. When only one object is changed, it invokes an internal method RenderElement. Conversely, when the scene or the camera is changed, it becomes recursive and updates all objects in the scene ... See you soon for the final release of the library tweened ...



