An OpenGL Graphics Library for pi


5 posts
by jmacey » Mon Jun 11, 2012 1:58 pm
I've nearly completed the port of my Graphics Library (NCCA Graphics Library or NGL) to the pi (piNGL) and I plan to release the code later this week as an alpha, so I thought I would ask people here where I should host it.

For my main stable teaching branch I host here http://nccastaff.bournemouth.ac.uk/jmacey/GraphicsLib/index.html which is a read only version which I maintain. This is so I can control it and students get a stable branch. For the pi Version I was thinking of hosting on Google Code so the community can access / update things as well as keeping a more stable version on my website as well.

I know this may cause issues with different versions but was wondering what others think?

I was also thinking of releasing both dev and pre-compiled lib / header versions so people could just download and use without having to build the library itself, one of the versions I've built has some rather large models pre-compiled into it and the only way of accessing these is to cross compile on another machine and I presume this may be a bit too much for some people.

I've just added texture support so now I just need to tidy a few things up and it's ready. Main things left to do will be Text rendering, and mouse / keyboard access, then I will start the python bindings for it (I have an old python version so should take a week or so)

The link below shows the latest version with textures working
http://youtu.be/JhoRNlyqh9A
Posts: 135
Joined: Thu May 31, 2012 1:05 pm
by jmacey » Mon Jun 11, 2012 2:29 pm
I've just added a very alpha download here http://nccastaff.bournemouth.ac.uk/jmacey/GraphicsLib/piNGL/index.html it may work for you, it may not but please let me know issues etc (and this is subject to major changes in the next few days as I'm about to merge the latest desktop branch code with it and there are a few major changes)
Posts: 135
Joined: Thu May 31, 2012 1:05 pm
by higwoth1 » Fri Jun 15, 2012 12:47 am
Hi,

Download, compiled etc this library. Ok working.

Playing around with the ObjDemo I'm not getting very far. I've got as far as loading two meshes (obj) and rendering them, but that's it.

How do I rotate each mesh separately? m_mesh2->scale() doesn't appear to do anything, or if it does it never gets rendered on the screen (m_mesh2->draw() )

I've looked at the Doxygen docs, but can't see how to go from an obj->abstrachmesh->something that is useful.
Posts: 26
Joined: Sat May 26, 2012 1:27 am
by jmacey » Fri Jun 15, 2012 8:33 am
usually you would need to do this for each mesh using

Code: Select all
m_transformStack.pushTransform()
 m_transformStack.setScale....
 m_transformStack.setPosition....
 m_transformStack.setRotation....
 loadMatricesToShader(m_transformStack)
 mesh1->draw
m_transformStack.popTransform()

m_transformStack.pushTransform()
 m_transformStack.setScale....
 m_transformStack.setPosition....
 m_transformStack.setRotation....
 loadMatricesToShader(m_transformStack)
 mesh2->draw...
m_transformStack.popTransform()



If you mail me the code I can have a look for you
Posts: 135
Joined: Thu May 31, 2012 1:05 pm
by higwoth1 » Fri Jun 15, 2012 10:31 am
Ah, thanks. I have somewhere to start from now. I'll have a play around and see what happens.
Posts: 26
Joined: Sat May 26, 2012 1:27 am