Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [sf3d] a project for 3D rendering  (Read 25561 times)

0 Members and 1 Guest are viewing this topic.

Lokk

  • Full Member
  • ***
  • Posts: 228
    • View Profile
    • http://betadineproject.wordpress.com/
[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 :
    - 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;
}

Jallen

  • Newbie
  • *
  • Posts: 39
    • View Profile
[sf3d] a project for 3D rendering
« Reply #1 on: August 20, 2010, 07:42:12 pm »
The sample code looks cool, but I don't understand why you would piggy back on SFML when you could use something much more minimalistic with identical results.

tonkosi

  • Newbie
  • *
  • Posts: 1
    • View Profile
[sf3d] a project for 3D rendering
« Reply #2 on: April 07, 2011, 05:11:43 pm »
Can I somewhere download sf3d?  :D  :?:

Lokk

  • Full Member
  • ***
  • Posts: 228
    • View Profile
    • http://betadineproject.wordpress.com/
[sf3d] a project for 3D rendering
« Reply #3 on: April 07, 2011, 10:06:11 pm »
Yeah, you can checkout the repository to get the source code using SVN :
Code: [Select]
svn checkout http://sf3d.googlecode.com/svn/trunk/ sf3d-read-only

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
[sf3d] a project for 3D rendering
« Reply #4 on: April 27, 2011, 01:38:52 am »
Hey, your project looks really interesting. Maybe this could be the solution to my small 3D game planned since eternities ;)

Have you thought about using a 3D graphics library like Irrlicht as backend instead of re-implementing everything on your own? Or maybe about forming a connection between SFML and Irrlicht (especially for the render window and the event handling?)
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

henrikno

  • Newbie
  • *
  • Posts: 8
    • View Profile
[sf3d] a project for 3D rendering
« Reply #5 on: June 08, 2011, 12:52:55 am »
Nice! It looks a lot like my personal helper classes. Maybe I'll contribute :)
Did you consider using AssImp for loading 3d meshes?

@Jallen: What is more minimalistic than SFML? I wouldn't say SDL is simpler to use than SFML.

@Nexus: IMO I find it fascinating to have something so simple you can keep the whole code in your head :)

Lokk

  • Full Member
  • ***
  • Posts: 228
    • View Profile
    • http://betadineproject.wordpress.com/
[sf3d] a project for 3D rendering
« Reply #6 on: June 08, 2011, 08:41:59 am »
Quote
Did you consider using AssImp for loading 3d meshes?

Yes, I definitely want to use the assimp loader.
It can load interchangeable formats and other game engine mesh files.
(see here for a complete list : http://assimp.sourceforge.net/main_features_formats.html)

It's NOT intended to be a complete engine, the goal is to have simple and performant helper classes  (Matrix, renderers, importers, scene graphs, culling classes, etc...) that fit as a higher level than OpenGL (like SFML does)

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
[sf3d] a project for 3D rendering
« Reply #7 on: June 10, 2011, 10:03:18 pm »
I would go with a custom file format. Using Assimp to load models on the fly can be time-consuming when using optimizations (e.g. removing doubled vertices, recalculating normals, transformations to match your coordinate system etc.).

You can still provide a simple converter tool that uses Assimp to load a model and converts it to your format. In that case you have the great compatibility of Assimp together with optimizations and fast loading times.

Alejandro

  • Newbie
  • *
  • Posts: 27
    • View Profile
[sf3d] a project for 3D rendering
« Reply #8 on: June 14, 2011, 02:48:29 pm »
Sorry to bring up such an old thread, but it seems that anyway it has been sort of revived. As I see that the project's activity is close to none on the google page I would like to ask if it will be further supported.

I want to make a 2D isometric game, but to add character customization it would be an overkill to render all the possible variations of equipment on different classes in every animation sequence and direction, so I decided that I want to use a 3D character and attach the items to the corresponding parts of it's body.

I know that nothing about skeletal animation, bone attachment or 3ds file loading has been posted by the OP, but if there is any chance that the project will be further developed, will these things be in it's feature list? I have tried linking Irrlicht with SFML so that I render the map and everything else from SFML and draw the character with attached items from Irrlicht, but the closest I could get was a white changing (due to animation) non-textured silhouette of the character on the map (probably due to the un-fixable openGL states mess up).

I really like SFML and want to use it for my game as it is straightforward, faster and easier to understand than every other 2D library I have come across, but if I can't get it to work with some 3D rendering as well, I might have to move on to another potential library (which I still haven't found).

Lokk

  • Full Member
  • ***
  • Posts: 228
    • View Profile
    • http://betadineproject.wordpress.com/
[sf3d] a project for 3D rendering
« Reply #9 on: June 14, 2011, 09:00:25 pm »
@Tank : sf3d is supposed to be as generic as possible. A converter tool ? Yes, why not using sf3d library ?
I can ensure that 3D integration is done as easily as possible within an SFML project. But, it's up to you to decide if you need a custom file format (for optimization reasons) for your project, and where appropriate, it will make sense to develop it, yes !

@Alejandro :
I know that some 2D engines uses 3D baked characters and split them to multiple tiles. (Holyspirit ?) It adds a lot of quality and realism to your scene.
To answer you, I will probably add keyframe animations and skinning since Assimp handle both of them.

The Floating Brain

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • http://www.gcggames.webs.com
Re: [sf3d] a project for 3D rendering
« Reply #10 on: July 30, 2012, 04:12:01 am »
Hello

I know you may have to dust off this project, however recently I've been attempting to build it.
My dilemma is I do not know what version of SFML you based it off of. I tried 1.6 and 2.0 however neither worked.

It looks like a really interesting project, any help would be appreciated thank you!

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10815
    • View Profile
    • development blog
    • Email
Re: [sf3d] a project for 3D rendering
« Reply #11 on: July 30, 2012, 09:06:00 am »
It's based on SFML 2 like the opening thread states but since the last post was over a year old and the development proably too, you can't expect it to be uptodate with SFML 2. If your lucky you maybe find a note which SFML commit was used last, otherwise you'll have bring it up to speed on your own.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

kurasu1415

  • Newbie
  • *
  • Posts: 37
    • View Profile
    • Email
Re: [sf3d] a project for 3D rendering
« Reply #12 on: July 30, 2012, 05:53:12 pm »
I suggest using the Autodesk FBX format. I have used Assimp in the past, and I have to say that it is slow, and a little bit overboard. FBX models have become a game industry standard because every 3D modelling program can easily export to it. It is also very easy to load. There is an open SDK made available by Autodesk (the creators of 3DS Max/Maya) specifically for loading and saving to this format. My suggestion would be to use FBX as your primary asset format. Feel free to PM me if you have any more questions. I am working on loading the FBX format myself, so when I get it working flawlessly, I can shoot some code your way.

The Floating Brain

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • http://www.gcggames.webs.com
Re: [sf3d] a project for 3D rendering
« Reply #13 on: August 02, 2012, 03:36:47 am »
It's based on SFML 2 like the opening thread states but since the last post was over a year old and the development proably too, you can't expect it to be uptodate with SFML 2. If your lucky you maybe find a note which SFML commit was used last, otherwise you'll have bring it up to speed on your own.

Thank you :-D

If I can't find which poll it was I most certanly I'll port it!
I suggest using the Autodesk FBX format. I have used Assimp in the past, and I have to say that it is slow, and a little bit overboard. FBX models have become a game industry standard because every 3D modelling program can easily export to it. It is also very easy to load. There is an open SDK made available by Autodesk (the creators of 3DS Max/Maya) specifically for loading and saving to this format. My suggestion would be to use FBX as your primary asset format. Feel free to PM me if you have any more questions. I am working on loading the FBX format myself, so when I get it working flawlessly, I can shoot some code your way.


Hey maybe when I get it working I can shoot it your way :-)

theodor

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: [sf3d] a project for 3D rendering
« Reply #14 on: August 07, 2012, 01:23:11 am »
I would really appreciate if somebody would make this work for sfml 2.0

 

anything