tag:blogger.com,1999:blog-5603505217904158002.post3056165773152472084..comments2023-06-11T15:05:09.489+01:00Comments on Mr Pfister's random waffle: My Pictures 3D Helix using WPF (Part 2 of 3)Kevin Pfisterhttp://www.blogger.com/profile/16522901540117081903noreply@blogger.comBlogger13125tag:blogger.com,1999:blog-5603505217904158002.post-42667765722014545892009-02-05T13:16:00.000+00:002009-02-05T13:16:00.000+00:00Hi am sry for posting the code...bt was able to co...Hi am sry for posting the code...bt was able to correct my mistake...thanks for the article...<BR/>pls do take out my previous comment...Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5603505217904158002.post-43979471601667500292009-02-05T11:51:00.000+00:002009-02-05T11:51:00.000+00:00Hi.. dont seem to get the shape of the helix...and...Hi.. dont seem to get the shape of the helix...and i follewed the steps but nt able to get the skewed rectangle of each picture...it like a triangle and the brush resource is nt proper...<BR/><BR/>here is the code...<BR/><BR/>private void CreateHelix()<BR/> {<BR/> double rotationanglee = 0.0;<BR/> foreach (string filename in FList)<BR/> {<BR/> try<BR/> {<BR/> ImageBrush _pictbrush = new ImageBrush(new BitmapImage(new Uri(filename)));<BR/> RenderOptions.SetCachingHint(_pictbrush, CachingHint.Cache);<BR/> RenderOptions.SetBitmapScalingMode(_pictbrush, BitmapScalingMode.LowQuality);<BR/> _pictbrush.ViewboxUnits = BrushMappingMode.Absolute;<BR/><BR/> double widthsize = spiral_Height / _pictbrush.ImageSource.Height * _pictbrush.ImageSource.Width;<BR/> double anglecovered = 1.0 / spiral_rad * widthsize;<BR/> int spiralsegments = (int)(spiral_SegmentRot / (2 * Math.PI) * anglecovered);<BR/><BR/> Model3DGroup picturemesh = new Model3DGroup();<BR/> for (int segmentindex = 0; segmentindex < spiralsegments; segmentindex++)<BR/> {<BR/> Point3D[] picturedPoints = new Point3D[4];<BR/> double Segstartangle = rotationanglee + anglecovered / spiralsegments * (segmentindex);<BR/> double SegEndangle = rotationanglee + anglecovered / spiralsegments * (segmentindex + 1);<BR/><BR/> picturedPoints[0] = new Point3D(spiral_rad * Math.Sin(SegEndangle), SegEndangle / (2 * Math.PI) * spiral_climb <BR/> + (double)spiral_Height / 2.0, spiral_rad * Math.Cos(SegEndangle));<BR/><BR/> picturedPoints[1] = new Point3D(spiral_rad * Math.Sin(Segstartangle), Segstartangle / (2 * Math.PI) * spiral_climb<BR/> + (double)spiral_Height / 2.0, spiral_rad * Math.Cos(Segstartangle));<BR/><BR/> picturedPoints[0] = new Point3D(spiral_rad * Math.Sin(SegEndangle), SegEndangle / (2 * Math.PI) * spiral_climb<BR/> - (double)spiral_Height / 2.0, spiral_rad * Math.Cos(SegEndangle));<BR/><BR/> picturedPoints[0] = new Point3D(spiral_rad * Math.Sin(Segstartangle), Segstartangle / (2 * Math.PI) * spiral_climb<BR/> - (double)spiral_Height / 2.0, spiral_rad * Math.Cos(Segstartangle));<BR/><BR/> picturemesh.Children.Add(CreateTriangle(filename, _pictbrush, picturedPoints[0], picturedPoints[1], picturedPoints[2],<BR/> new Point(1.0 / (double)spiralsegments * (double)(segmentindex + 1), 0.0), new Point(1.0 / (double)spiralsegments * (double)(segmentindex), 0.0),<BR/> new Point(1.0 / (double)spiralsegments * (double)(segmentindex + 1), 1.0)));<BR/><BR/><BR/> picturemesh.Children.Add(CreateTriangle(filename, _pictbrush, picturedPoints[2], picturedPoints[1], picturedPoints[3],<BR/> new Point(1.0 / (double)spiralsegments * (double)(segmentindex + 1), 1.0), new Point(1.0 / (double)spiralsegments * (double)(segmentindex), 0.0),<BR/> new Point(1.0 / (double)spiralsegments * (double)(segmentindex), 1.0)));<BR/><BR/> picturemesh.Children.Add(CreateTriangle(filename, _pictbrush, picturedPoints[1], picturedPoints[0], picturedPoints[2],<BR/> new Point(1.0 / (double)spiralsegments * (double)(segmentindex), 0.0), new Point(1.0 / (double)spiralsegments * (double)(segmentindex+1), 0.0),<BR/> new Point(1.0 / (double)spiralsegments * (double)(segmentindex + 1), 1.0)));<BR/><BR/> picturemesh.Children.Add(CreateTriangle(filename, _pictbrush, picturedPoints[3], picturedPoints[1], picturedPoints[2],<BR/> new Point(1.0 / (double)spiralsegments * (double)(segmentindex ), 1.0), new Point(1.0 / (double)spiralsegments * (double)(segmentindex), 0.0),<BR/> new Point(1.0 / (double)spiralsegments * (double)(segmentindex + 1), 1.0)));<BR/> }<BR/><BR/> ModelVisual3D model = new ModelVisual3D();<BR/> model.Content = picturemesh;<BR/> mainViewPort.Children.Add(model);<BR/> rotationanglee += anglecovered + spiral_Divider;<BR/> }<BR/> catch<BR/> {<BR/><BR/> }<BR/> }<BR/> }Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5603505217904158002.post-90537187761260793622008-09-26T23:46:00.000+01:002008-09-26T23:46:00.000+01:00Great Work dude! Cool idea :)!Keep up the good (WP...Great Work dude! Cool idea :)!<BR/>Keep up the good (WPF) work!<BR/><BR/>Ping Back - Http://holsee.blogspot.comholseehttps://www.blogger.com/profile/17183052407784250563noreply@blogger.comtag:blogger.com,1999:blog-5603505217904158002.post-52787213638845901922008-09-18T17:30:00.000+01:002008-09-18T17:30:00.000+01:00thx for the reference. Happy 3D coding!-Mikethx for the reference. Happy 3D coding!<BR/><BR/>-MikeAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-5603505217904158002.post-44285740855720332752008-09-17T18:47:00.001+01:002008-09-17T18:47:00.001+01:00very awsome.very awsome.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5603505217904158002.post-20441787599374957512008-09-17T18:47:00.000+01:002008-09-17T18:47:00.000+01:00This comment has been removed by a blog administrator.Adnanhttps://www.blogger.com/profile/11521266662899849236noreply@blogger.comtag:blogger.com,1999:blog-5603505217904158002.post-51939784310591094622008-09-17T18:43:00.000+01:002008-09-17T18:43:00.000+01:00Quite entertainingCheck out my blog at http://offb...Quite entertaining<BR/><BR/>Check out my blog at http://offbeatspirituality.blogspot.com/ <BR/><BR/>ThanksNitima Soodhttps://www.blogger.com/profile/15475233496880000861noreply@blogger.comtag:blogger.com,1999:blog-5603505217904158002.post-43741264432059050352008-09-17T18:37:00.000+01:002008-09-17T18:37:00.000+01:00what happened to the other one?what happened to the other one?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5603505217904158002.post-87250399336753526212008-09-17T18:34:00.000+01:002008-09-17T18:34:00.000+01:00very cool.very cool.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5603505217904158002.post-35169886634692230882008-09-17T18:27:00.000+01:002008-09-17T18:27:00.000+01:00wow, very special, i like it.wow, very special, i like it.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5603505217904158002.post-67785419103038955032008-09-17T18:25:00.000+01:002008-09-17T18:25:00.000+01:00very cool.very cool.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5603505217904158002.post-39881444568611899402008-09-17T18:24:00.000+01:002008-09-17T18:24:00.000+01:00its good to know about it? where did you get that ...its good to know about it? where did you get that information?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5603505217904158002.post-7433692359175674732008-09-17T18:22:00.000+01:002008-09-17T18:22:00.000+01:00ok. I found an information here that i want to loo...ok. I found an information here that i want to look for.Anonymousnoreply@blogger.com