[of-dev] glm

Theodore Watson theo at openframeworks.cc
Mon Mar 28 11:06:43 PDT 2016


Thanks for the feedback Elliot! 

Arturo and I had a chat about it this morning and I think the idea is to proceed with merging the branch.

- This will mean OF will use glm internally 
- ofPoint and ofVec3f will auto convert to glm and vice versa. 
- The examples will continue to use ofPoint and ofVec2f etc 
- There will be an example added on how to use glm and how it differs from the OF vector math api. 
- People can use glm if they want to for everything with a #define switch in ofConstants.h ( this mainly affects a few functions which return vector <ofPoint> where the auto conversion can't be done. 
- The approach will be conservative and we can use a couple of non patch releases of it being available and part of the core, to see how people respond to it, if there are any issues and if not if we want to bring it into OF in a bigger way ( use it for all examples, deprecate the old vector math code etc ). 

It would be good however to see what fixes can be made to the ofVectorMath api as people will be using it for a while to come, so I would be happy to put some effort into fixing anything that is inconsistent or unclear.  

----------------------------------------------
Theo Watson
http://theowatson.com 
http://openframeworks.cc
----------------------------------------------

On Mar 28, 2016, at 1:39 PM, Elliot Woods <elliot at kimchiandchips.com> wrote:

> I hope we figure this out
> 
> The current vector math has given me nightmares
> You never know when it's going to fail. Which cans drive you insane as you don't know if it's you or the library that's wrong
> Simple inversions often go crazy, and the API is totally asymmetrical right now
> So if ofMatrix3x3 got to that standard... Then it would still be horrifying
> 
> One suggestion is we should move to:
> 1. using glm internally in ofVec*, etc. Use glm for calculating the math operations
> 2. Use glm universally as arguments/returns in our API
> 3. Auto convert between the two (without toOf/toGlm, even if that means making a copy when it's a vector)
> 
> I.e. a side by side approach with glm being the core usage, and ofVec* being 'utility classes' (optimised for keeping past styles, not speed)
> 
> 
> (Maybe that's what's on the table already?)
> 
> Elliot
> 
> 
> On Mon, 28 Mar 2016 at 23:11, arturo castro <arturo at openframeworks.cc> wrote:
> > Call me old-fashioned, but I prefer the last option, with separate explicit functions for degrees and radians. It's ultra-clear and it doesn't require creating a new Angle class.  Introductory students will appreciate the lack of ambiguity.
> >
> 
> Yes i also think it might be the easiest/simplest. the angle class would
> have some advantages if it was something standard but being only in the
> OF calls it won't make much difference anyway.
> 
> > I would be much more in favor of an approach that let you easily convert ofVec3f and a vector of ofVec3f to glm::vec3. I think making it available to advanced users more in the way addons are available makes more sense that swapping the whole vector math API in one big go.
> 
> This is already there, or do you mean not using glm at all in the core
> and still use ofVec3f?
> 
> >
> > I think it could still make sense to take the steps of making angle arguments clear.  We already have ofGetAngleDifferenceDegrees and ofGetAngleDifferenceRadians so ofRotateDegrees etc fits
> 
> Makes sense although those 2 are actually useless since the current
> implementation is unit independent :) we just keep them cause at some
> point it wasn't
> 
> 
> >
> > I know our current vector math is not perfect but whatever we do we are going to need to rely on it for a while longer, so we could take a look at fixing the things which don't work or are confusing and bring the matrix3x3 class up to par with the 4x4
> 
> Who's going to fix and maintain ofMatrix3x3 an 4x4 and in general the
> whole vector math code? i think it's the kind of code that it's way out
> of our scope it's been unmaintained for years and i doubt anybody is
> going to fix it, much less maintain it over time. glm has some issues,
> mainly differences with how we are used to do things right now but it's
> kind of a standard so i think it's probably the best choice going forward.
> 
> 
> _______________________________________________
> of-dev mailing list
> of-dev at dev.openframeworks.cc
> http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc
> _______________________________________________
> of-dev mailing list
> of-dev at dev.openframeworks.cc
> http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://dev.openframeworks.cc/pipermail/of-dev-openframeworks.cc/attachments/20160328/43688f48/attachment-0001.htm>


More information about the of-dev mailing list