Forum

Standards for 2D transforming

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

Standards for 2D transforming

Postby mankrip » Fri Jun 18, 2010 5:55 pm

I've been studying some 2D transforming techniques, and the AffineTransform class in Java's AWT seems really powerful, easy and flexible.

I'd like to code a 2D transformation class/library as flexible as that, but it occurred to me that there may already be some well-adopted standards for this in OpenGL, Direct3D or somewhere else. So, what I'm looking for is to code my library in a way that allows it to be easily replaced by or integrated with the pipeline of other 2D transforming libraries.

Any suggestions?
Ph'nglui mglw'nafh mankrip Hell's end wgah'nagl fhtagn.
==-=-=-=-=-=-=-=-=-=-==
Dev blog / Twitter / YouTube
User avatar
mankrip
 
Posts: 915
Joined: Fri Jul 04, 2008 3:02 am

Postby Zylyx_ » Fri Jun 18, 2010 10:52 pm

Everything is done 3D, even things that seem to be 2D transformations they are done in 3D. There is no point in writing a matrix library/interface, since there are so many well written and free to use ones out there. Also, unless you know exactly what you are doing, chances are you are gonna end up with half assed matrix class that works not even half as well as other matrix operation classes out there.

Same goes for vector, quaternion and other misc maths functionality. OpenGL already provides a standardazied method for performing 2D rendering in a 3D scene.

http://www.opengl.org/resources/faq/technical/transformations.htm
....noodle...
Zylyx_
 
Posts: 111
Joined: Wed Dec 05, 2007 6:52 pm
Location: scotland, uk

Postby Zylyx_ » Fri Jun 18, 2010 10:54 pm

....noodle...
Zylyx_
 
Posts: 111
Joined: Wed Dec 05, 2007 6:52 pm
Location: scotland, uk

Postby mh » Fri Jun 18, 2010 11:17 pm

Direct3D comes with an incredibly rich set of matrix routines that cover just about anything you might want to do, are hyper-optimised, will give you SSE/etc support, and so on. They can even be linked to an OpenGL (or general math) program and used in that as they don't require a Device to be created. No D3D programmer in their right mind would use anything else; they might wrap them to handle conversion from in-game data types to D3D data types, and they might write special-case versions for specific circumstances that a generic library can't foresee, but otherwise why reinvent the wheel?

Unless it's fun of course, in which case by all means power ahead! :D
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Postby mankrip » Fri Jun 25, 2010 6:53 am

Thanks, I'm going to study all that.
Ph'nglui mglw'nafh mankrip Hell's end wgah'nagl fhtagn.
==-=-=-=-=-=-=-=-=-=-==
Dev blog / Twitter / YouTube
User avatar
mankrip
 
Posts: 915
Joined: Fri Jul 04, 2008 3:02 am


Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest