1
SFML projects / [sf3d] a project for 3D rendering
« on: August 20, 2010, 02:06:40 pm »
Hi all,
I just let you know that I am working on a 3D engine project, based on the SFML 2.0 library.
Here are some features :
sf3d often changes, there are a lot of improvements to do.
If someone is interested to contribute to the project, doors are open.
The official site is here : sf3d google code with some images and svn sources.
For example, a simple OBJ importer with sf3d library
The cube file.
I just let you know that I am working on a 3D engine project, based on the SFML 2.0 library.
Here are some features :
- - Loaders for 3D animated meshes (.md2) and static meshes (.obj)
- An fps camera in order to visit simply your worlds.
- Scene management and multipass rendering (FBO)
- Terrain generation with heightmaps
- Materials, textures and lights
- Support for vertex and fragment shaders GLSL
sf3d often changes, there are a lot of improvements to do.
If someone is interested to contribute to the project, doors are open.
The official site is here : sf3d google code with some images and svn sources.
For example, a simple OBJ importer with sf3d library
The cube file.
Code: [Select]
#include <SFML/Graphics.hpp>
#include <sf3d.hpp>
int main(int ac, char **av)
{
sf::RenderWindow win(sf::VideoMode(800, 600), "sf3d - SFML 3D rendering");
win.SetFramerateLimit(60);
sf3d::Init();
sf3d::Renderer& renderer = sf3d::Renderer::GetSingleton();
renderer.Init(win);
sf3d::FpsCamera cam;
cam.SetPosition(sf::Vector3f(0, 0, -4));
sf3d::OBJMeshLoader loader;
sf3d::MeshNode node(loader.Load("cube.obj"));
sf3d::Scene scene;
scene.SetCamera(&cam);
scene.Add(&node);
sf3d::Light light;
light.SetPosition(sf::Vector3f(15, 15, 15));
scene.AddLight(&light);
renderer.SetScene(&scene);
while (win.IsOpened())
{
sf::Event event;
while (win.GetEvent(event))
{
if (event.Type == sf::Event::Closed || (event.Type == sf::Event::KeyPressed && event.Key.Code == sf::Key::Escape))
win.Close();
if (event.Type == sf::Event::Resized)
renderer.Resize();
}
win.Clear();
renderer.Display();
win.Display();
}
return 0;
}