![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I'm trying to get my head around working with the Matrix class. I'm doing something manually that I'd prefer to do with a transformation. Basically I have shape objects that are responsible for drawing themselves on a surface. The shapes all store their Positions. I calculate an offset factor and all shapes should take their x coordinates and multiply by the offset factor for their new position. So if a shape's position is (100,50) and my offset factor is 0.5, the new position should be (50,50). What I do now is have each shape do this multiplication individually. I'd rather use a transformation. How can I apply this offset using some sort of transformation? Many thanks |
#3
| |||
| |||
|
|
Oh, and I'm working in C# "mash" wrote: I'm trying to get my head around working with the Matrix class. I'm doing something manually that I'd prefer to do with a transformation. Basically I have shape objects that are responsible for drawing themselves on a surface. The shapes all store their Positions. I calculate an offset factor and all shapes should take their x coordinates and multiply by the offset factor for their new position. So if a shape's position is (100,50) and my offset factor is 0.5, the new position should be (50,50). What I do now is have each shape do this multiplication individually. I'd rather use a transformation. How can I apply this offset using some sort of transformation? Many thanks |
#4
| |||
| |||
|
|
See my animation example in Windows Forms Tips and Tricks. -- Bob Powell [MVP] Visual C#, System.Drawing Ramuseco Limited .NET consulting http://www.ramuseco.com Find great Windows Forms articles in Windows Forms Tips and Tricks http://www.bobpowell.net/tipstricks.htm Answer those GDI+ questions with the GDI+ FAQ http://www.bobpowell.net/faqmain.htm All new articles provide code in C# and VB.NET. Subscribe to the RSS feeds provided and never miss a new article. mash wrote: Oh, and I'm working in C# "mash" wrote: I'm trying to get my head around working with the Matrix class. I'm doing something manually that I'd prefer to do with a transformation. Basically I have shape objects that are responsible for drawing themselves on a surface. The shapes all store their Positions. I calculate an offset factor and all shapes should take their x coordinates and multiply by the offset factor for their new position. So if a shape's position is (100,50) and my offset factor is 0.5, the new position should be (50,50). What I do now is have each shape do this multiplication individually. I'd rather use a transformation. How can I apply this offset using some sort of transformation? Many thanks |
#5
| |||
| |||
|
|
Hi Bob, Thanks. I had already downloaded that example and used it to help come up with the design of my shape objects. So each of your shapes handles it's own transformations, that will work great with what I'm doing. Thanks "Bob Powell [MVP]" wrote: See my animation example in Windows Forms Tips and Tricks. -- Bob Powell [MVP] Visual C#, System.Drawing Ramuseco Limited .NET consulting http://www.ramuseco.com Find great Windows Forms articles in Windows Forms Tips and Tricks http://www.bobpowell.net/tipstricks.htm Answer those GDI+ questions with the GDI+ FAQ http://www.bobpowell.net/faqmain.htm All new articles provide code in C# and VB.NET. Subscribe to the RSS feeds provided and never miss a new article. mash wrote: Oh, and I'm working in C# "mash" wrote: I'm trying to get my head around working with the Matrix class. I'm doing something manually that I'd prefer to do with a transformation. Basically I have shape objects that are responsible for drawing themselves on a surface. The shapes all store their Positions. I calculate an offset factor and all shapes should take their x coordinates and multiply by the offset factor for their new position. So if a shape's position is (100,50) and my offset factor is 0.5, the new position should be (50,50). What I do now is have each shape do this multiplication individually. I'd rather use a transformation. How can I apply this offset using some sort of transformation? Many thanks |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |