Rotating Images

Discussion regarding the development of CEGUI itself - as opposed to questions about CEGUI usage that should be in the help forums.

Moderators: CEGUI MVP, CEGUI Team

User avatar
gcarlton
Just can't stay away
Just can't stay away
Posts: 149
Joined: Wed Jan 12, 2005 12:06

Rotating Images

Postby gcarlton » Mon Apr 04, 2005 01:03

I'm going to add support for static images that are displayed with a rotation. This involves:

* StaticImage::setRotation(float) new function
* RenderableElement::draw() with extra rotation argument
* RenderableElement::draw_impl() with extra rotation argument
* Image::draw() with extra rotation argument
* ImageSet::draw() with extra rotation argument
* Renderer::addQuad() with extra rotation argument
* Rect helper function to get rotated corner points
* D3D9 render to support rotated quads

This is a big list of lots of small changes! Also, I'm only going to support the renderer I actually use, but if others are interested I'm hoping we can get this supported across the board.

The actual guts of it is simple, instead of rendering a quad with the rect's TL/TR/BL/BR, you ask the rect to give you 4 corner points for a given rotation value. Clipping is more problematic, since you wouldn't be rendering simple quads anymore (I'm not going to worry about it for now).

Another point is that this indirection is a maintenance headache, so it might be better to pass a DrawInfo struct around, which can have arguments added in a nicer way. However, I probably wont do this, as its just making a large change even larger.

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: Rotating Images

Postby lindquist » Mon Apr 04, 2005 14:55

I think this sounds like a great feature...

spinning icons would be cool :P

As I see it, clipping is'nt that big a problem. The feature is so specialized that the widgets using it could easily calculate bounding rects, and I don't think true diagonal clipping will be needed!

User avatar
gcarlton
Just can't stay away
Just can't stay away
Posts: 149
Joined: Wed Jan 12, 2005 12:06

Re: Rotating Images

Postby gcarlton » Mon Apr 04, 2005 23:40

I've done the change and it works fine. I'm not sure what to do about a patch file though - I've made one up, however my d3d renderer has lots of extra code in there (I've been experimenting with a custom stl allocator for the quadlist), so that class is a bit of a mess.

If anybody is interested I can submit the patch anyway, and anyone who wants to use will have to remove the extra stl allocator class in d3drenderer after applying the patch. Alternatively, I could try snipping those changes out of the patch file, but I've probably invalidate the file since its all interwoven there.

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: Rotating Images

Postby lindquist » Tue Apr 05, 2005 00:22

why dont you just get a fresh copy from CVS.
apply the changes there and make the patch?

User avatar
gcarlton
Just can't stay away
Just can't stay away
Posts: 149
Joined: Wed Jan 12, 2005 12:06

Re: Rotating Images

Postby gcarlton » Tue Apr 05, 2005 02:12

Yeah that would work. :)

Mainly because its done now, and my first priority is to get the gui working as I need for my project. As such I have made lots of changes which make it easier for myself but aren't a good idea in general.

As such I don't really want to get a clean copy of cvs, make changes there, submit a clean patch, and then somehow merge it in with my other changes.

Anyway, I put the patch up (changes plus d3d9 mess), but I don't know what use it will be. :oops:

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: Rotating Images

Postby lindquist » Tue Apr 05, 2005 13:09

I took it back!

User avatar
gcarlton
Just can't stay away
Just can't stay away
Posts: 149
Joined: Wed Jan 12, 2005 12:06

Re: Rotating Images

Postby gcarlton » Wed Apr 06, 2005 23:58

Well ok! However I agree that a patch with the extra code is a bit useless. If I have some time (which I don't, at the moment), I can clean it up and resubmit it.

Note that I think a custom allocator for the d3d9 renderer is a good idea, it just needs some cleaning up.

User avatar
tgraupmann
Quite a regular
Quite a regular
Posts: 78
Joined: Thu Aug 18, 2005 00:47
Contact:

Re: Rotating Images

Postby tgraupmann » Sat Dec 03, 2005 00:08

Does StaticImage rotation work yet?

User avatar
gcarlton
Just can't stay away
Just can't stay away
Posts: 149
Joined: Wed Jan 12, 2005 12:06

Re: Rotating Images

Postby gcarlton » Tue Dec 13, 2005 22:55

I did the changes to a clean copy from cvs and submitted a new patch, that was a few months ago.

It hasn't been merged in by the team, and Falagard has quite a few changes so it may be end up being problematic for them to do so, I'm not sure. However the patch file is there if anybody wants to use it.

User avatar
arkos
Quite a regular
Quite a regular
Posts: 49
Joined: Thu Apr 27, 2006 21:45

Postby arkos » Mon Jun 12, 2006 22:02

I was just wondering if there was going to be any native support in CEGUI for rotating images, anytime soon?


Return to “CEGUI Library Development Discussion”

Who is online

Users browsing this forum: No registered users and 3 guests