![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | 3D, Canvas, and Databinding I'm looking to replicate something I once did in Flash, but I'm not sure what is the best approach. Essentialy, I have a collection of objects that with x,y,z coordinates. (Let's it's a collection of Planet classes and I'm modelling the solar system.) I want to display theses object in 3D. However, I don't care to represent the objects themselves as meshes. In other world, the "planets" don't need to be "spheres", I just want their relative positions. Additionally, I want to provide the user with a slider for rotating the solar system around an axis (the Sun). I would like to use databinding, but it is not a requirement. The number of "planets" in solar system is dynamic (the results of a database query). I thought that using the builtin 3D might be overkill (and I didn't think that I could bind data.) I have toyed with a Canvas and "transforming" the position of using pseudo 3D (2.5D, the way it's typically done in Flash). I have also looked at several online example of 3D in XAML, but most of them seem "larger" than what I expect that I need. (I'm expecting it to take less code in WinFX than it did in Flash). Recommendations? many thanks, Christopher Bennage |
My System Specs![]() |
| | #2 (permalink) |
| | Re: 3D, Canvas, and Databinding If you don't want to make the planets into full blown meshes, you can use 3D billboarding instead which will be easier than doing the pseudo-3D by hand. A billboard is a textured plane that faces the camera. For example, each planet is a separate GeometryModel3D with a DiffuseMaterial with an ImageBrush of the planet's picture ("pluto.png" or whatever). Every planet then uses the same MeshGeometry3D plane which is made up of two triangles that face the camera. You can then use Transform3Ds to position everything. Animation and databinding does work on 3D content as well. Jordan "Christopher Bennage" <ChristopherBennage@discussions.microsoft.com> wrote in message news D675C6B-5413-4C56-B4F4-F011D3C2EAC1@microsoft.com...> I'm looking to replicate something I once did in Flash, but I'm not sure > what > is the best approach. > Essentialy, I have a collection of objects that with x,y,z coordinates. > (Let's it's a collection of Planet classes and I'm modelling the solar > system.) I want to display theses object in 3D. However, I don't care to > represent the objects themselves as meshes. In other world, the "planets" > don't need to be "spheres", I just want their relative positions. > Additionally, I want to provide the user with a slider for rotating the > solar > system around an axis (the Sun). > I would like to use databinding, but it is not a requirement. The number > of > "planets" in solar system is dynamic (the results of a database query). > I thought that using the builtin 3D might be overkill (and I didn't think > that I could bind data.) I have toyed with a Canvas and "transforming" > the > position of using pseudo 3D (2.5D, the way it's typically done in Flash). > I have also looked at several online example of 3D in XAML, but most of > them > seem "larger" than what I expect that I need. (I'm expecting it to take > less > code in WinFX than it did in Flash). > Recommendations? > > many thanks, > Christopher Bennage |
My System Specs![]() |
| | #3 (permalink) |
| | Re: 3D, Canvas, and Databinding Thanks Jordan. Can you point me toward any examples that use Databinding with 3D content? Hopefully soemthing along the lines of binding a List<Planet> to a Viewport3D and ending up with a number of ModelVisual3D instances positioned (or tranformed?) based upon the values in List<Planet>. I have something like this working now, but I am not using databinding. I am iterating through the list and adding the visuals manually and I'm storing the association between the Planet instances and the visuals in a Dictionary<>. "Jordan Parker [MSFT]" wrote: > If you don't want to make the planets into full blown meshes, you can use 3D > billboarding instead which will be easier than doing the pseudo-3D by hand. > A billboard is a textured plane that faces the camera. > > For example, each planet is a separate GeometryModel3D with a > DiffuseMaterial with an ImageBrush of the planet's picture ("pluto.png" or > whatever). Every planet then uses the same MeshGeometry3D plane which is > made up of two triangles that face the camera. You can then use Transform3Ds > to position everything. > > Animation and databinding does work on 3D content as well. > > Jordan > > "Christopher Bennage" <ChristopherBennage@discussions.microsoft.com> wrote > in message news D675C6B-5413-4C56-B4F4-F011D3C2EAC1@microsoft.com...> > I'm looking to replicate something I once did in Flash, but I'm not sure > > what > > is the best approach. > > Essentialy, I have a collection of objects that with x,y,z coordinates. > > (Let's it's a collection of Planet classes and I'm modelling the solar > > system.) I want to display theses object in 3D. However, I don't care to > > represent the objects themselves as meshes. In other world, the "planets" > > don't need to be "spheres", I just want their relative positions. > > Additionally, I want to provide the user with a slider for rotating the > > solar > > system around an axis (the Sun). > > I would like to use databinding, but it is not a requirement. The number > > of > > "planets" in solar system is dynamic (the results of a database query). > > I thought that using the builtin 3D might be overkill (and I didn't think > > that I could bind data.) I have toyed with a Canvas and "transforming" > > the > > position of using pseudo 3D (2.5D, the way it's typically done in Flash). > > I have also looked at several online example of 3D in XAML, but most of > > them > > seem "larger" than what I expect that I need. (I'm expecting it to take > > less > > code in WinFX than it did in Flash). > > Recommendations? > > > > many thanks, > > Christopher Bennage > > > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: 3D, Canvas, and Databinding Jordan Parker [MSFT] wrote: > If you don't want to make the planets into full blown meshes, you can use 3D > billboarding instead which will be easier than doing the pseudo-3D by hand. > A billboard is a textured plane that faces the camera. Jordan, how would you do billboards in XAML? Would it be possible to do that without code behind, e.g. using a nifty binding expression? Florian |
My System Specs![]() |
| | #5 (permalink) |
| | Re: 3D, Canvas, and Databinding I don't have any offhand, but have you seen Daniel Lehenbauer's latest video on WPF 3D(http://msdn.microsoft.com/msdntv/epi...manifest.xml)? He shows some databinding demos and you can get the source for them here: http://viewport3d.com/Blog_Files/MSDN_TV_Source.htm Jordan "Christopher Bennage" <ChristopherBennage@discussions.microsoft.com> wrote in message news:02C312BC-7D02-4255-A3BF-5C29DA3AA1FA@microsoft.com... > Thanks Jordan. Can you point me toward any examples that use Databinding > with 3D content? > Hopefully soemthing along the lines of binding a List<Planet> to a > Viewport3D and ending up with a number of ModelVisual3D instances > positioned > (or tranformed?) based upon the values in List<Planet>. > I have something like this working now, but I am not using databinding. I > am > iterating through the list and adding the visuals manually and I'm storing > the association between the Planet instances and the visuals in a > Dictionary<>. > > "Jordan Parker [MSFT]" wrote: > >> If you don't want to make the planets into full blown meshes, you can use >> 3D >> billboarding instead which will be easier than doing the pseudo-3D by >> hand. >> A billboard is a textured plane that faces the camera. >> >> For example, each planet is a separate GeometryModel3D with a >> DiffuseMaterial with an ImageBrush of the planet's picture ("pluto.png" >> or >> whatever). Every planet then uses the same MeshGeometry3D plane which is >> made up of two triangles that face the camera. You can then use >> Transform3Ds >> to position everything. >> >> Animation and databinding does work on 3D content as well. >> >> Jordan >> >> "Christopher Bennage" <ChristopherBennage@discussions.microsoft.com> >> wrote >> in message news D675C6B-5413-4C56-B4F4-F011D3C2EAC1@microsoft.com...>> > I'm looking to replicate something I once did in Flash, but I'm not >> > sure >> > what >> > is the best approach. >> > Essentialy, I have a collection of objects that with x,y,z coordinates. >> > (Let's it's a collection of Planet classes and I'm modelling the solar >> > system.) I want to display theses object in 3D. However, I don't care >> > to >> > represent the objects themselves as meshes. In other world, the >> > "planets" >> > don't need to be "spheres", I just want their relative positions. >> > Additionally, I want to provide the user with a slider for rotating the >> > solar >> > system around an axis (the Sun). >> > I would like to use databinding, but it is not a requirement. The >> > number >> > of >> > "planets" in solar system is dynamic (the results of a database query). >> > I thought that using the builtin 3D might be overkill (and I didn't >> > think >> > that I could bind data.) I have toyed with a Canvas and "transforming" >> > the >> > position of using pseudo 3D (2.5D, the way it's typically done in >> > Flash). >> > I have also looked at several online example of 3D in XAML, but most of >> > them >> > seem "larger" than what I expect that I need. (I'm expecting it to >> > take >> > less >> > code in WinFX than it did in Flash). >> > Recommendations? >> > >> > many thanks, >> > Christopher Bennage >> >> >> |
My System Specs![]() |
| | #6 (permalink) |
| | Re: 3D, Canvas, and Databinding I don't think so but I would love to be proved wrong on this. The few ways I can think of trying all involve some math (i.e. decomposing LookDirection into three rotations). Plus you'd have to account for any other transformations between the billboard and the camera. Jordan "Florian Kruesch" <nospam@kruesch.de> wrote in message news:Os2TXXkfGHA.2456@TK2MSFTNGP04.phx.gbl... > Jordan Parker [MSFT] wrote: >> If you don't want to make the planets into full blown meshes, you can use >> 3D billboarding instead which will be easier than doing the pseudo-3D by >> hand. A billboard is a textured plane that faces the camera. > > Jordan, how would you do billboards in XAML? Would it be possible > to do that without code behind, e.g. using a nifty binding expression? > > Florian |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Canvas does not allow drawing | Vista General | |||