GPU utilisation

Hello, this is my first post on this site, I have a question about C++ graphics. I have 2 years experience in hobby C++.

I have been experimenting with SDL for a few weeks, and have created a 3d perspective engine over the top of the 2d functionality. The problem is that I can only access single pixels (or 90 degree oriented rectangles that are only useful for refreshing the screen)

I am now looking for a method of writing triangles to the screen. I looked at GL, but it is so confusing, and I have 11 months to finish a flight simulator! (Fortunately there is no pressure for fancy graphics).

Now, I need a library that can write triangles, specifying three co-ordinates, and uses the GPU in doing so. It would also be nice to have a depth buffer. Given these conditions I can recreate the 3d perspective I have made using the atan2() function in SDL. The inbuilt 3d perspective in GL is strange, it is using a parallel perspective, which is no good for what I need, as more distant objects appear no smaller.

*Edit: I forgot to mention, I am using a raspi 3 on Raspbian.

I look forward to your ideas.
Last edited on
I'm not sure if this helps but there are other libraries better suited for this type of application. irrlicht http://irrlicht.sourceforge.net/ and ogre http://www.ogre3d.org/ are graphics libraries better suited for 3d applications. SDL if I'm not mistaken is better for 2D.

I hate to tell you to start over as I'm sure you have already done a good bit of work. Hope this helps.
Last edited on
They are open source so you should be able to compile on a rasp pi.
The inbuilt 3d perspective in GL is strange, it is using a parallel perspective, which is no good for what I need, as more distant objects appear no smaller.

Sounds like you're using an orthographic projection matrix and you need to use a perspective projection matrix. You might want to have a look at: http://www.scratchapixel.com/lessons/3d-basic-rendering/perspective-and-orthographic-projection-matrix/projection-matrix-introduction

Thanks for all the replies, I will be looking into irrlicht and ogre as you have suggested. I will also be looking at the perspective which I was not aware of.

Thank you,
Rob
Topic archived. No new replies allowed.