Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Graphics transformations
Message
De
02/12/2005 09:17:04
Keith Payne
Technical Marketing Solutions
Floride, États-Unis
 
 
À
02/12/2005 05:06:06
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Divers
Thread ID:
01072429
Message ID:
01074189
Vues:
7
>Hi,
>
>Sorry for the delay in replying.
>
>>The cleanest approach is to transform all of the native shapes into a common world coordinate system and then use that system to transform the world coordinates to the hardware coordinates to plot the shapes.
>
>Not sure I understand this. Aren't shapes always defined using world space co-ordinates?
>
>Perhaps a concrete example will help to clarify my problem:
>Assume a surface on which I am going to draw three rectangles. I need a global transformation to apply a pan/zoom effect so set up my basic world transformation to accomplish this. Now the three rectangles each additionally need their own (differing) translate/rotate transformations applied. No problems here either - I can apply the additional transformation, draw the rectangle, remove the transformation, move on to the next etc...(Graphics.BeginContainer/EndContainer looks useful here)
>
>Now I've all three on the display where I want them - here comes a Mousedown (or worse a Mousemove). I can invert the global world transform to negate the original pan/zoom but to determine which rectangles (if any) are 'beneath' the mouse I must also invert each individual transformation. It is finding the most efficient way of doing this that I'm stuck on. Obviously I must test each shape individually. If the shapes were just rectangles with no rotation it would probably be best to store their page space co-ordinates when these changed and thus avoid having to invert each time the test was made. But rotation will be involved - and not all shapes will be simple rectangles so that's not really an option. In fact I'm beginning to think that *all* of my shapes should be defined as either paths or regions - for one thing it looks as if both of these have their own transform method which will automatically be applied 'on top' of any global world transformation....
>
>
>>There is quite a bit of material on efficient sorting of objects to make the search more efficient in the comp.graphics.algorithms newsgroup. Start with the FAQ and if you don't find the answer there, try searching the group for it.
>
>I think I need to dig deeper here - I haven't found relevant bits yet. In fact haven't really found any source that confirms I'm on the right track - or suggests any alternative approach. I've been looking for a good graphics book that covers this sort of thing but they all seem to stop short of what I need. I guess some experimentation is called for......
>
>Best,
>Viv

Viv,

You are right, I did not understand the problem. I thought you were taking shapes from disparate coordinate systems, coalescing them into a homogenous system, and then transforming & mapping them to the GDI.

FYI there is a book reference in the comp.graphics.algorithms FAQ. Here is a link to the FAQ document on the web: http://www.faqs.org/faqs/graphics/algorithms-faq/

The regular posters to that forum are very helpful, although they do enjoy using jargon that makes it slow reading at times.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform