Tech Off Thread

8 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Rotate a 2D drawing in 3D space in Avalon?

Back to Forum: Tech Off
  • User profile image
    z33driver

    I have a 2D drawing in XAML.  I'd like to rotate this in 3D space and then plot some bars rising off of the drawing vertically.  Does anyone know of a simple way to do this?

    I don't want to have to convert my drawing into a Mesh, because I want to be able to load different drawings easily.

    I'm trying to do this in XAMLON, although a solution that works on the WinFX Beta 1 is fine too.  I just need to figure out how this can be done, worry about porting it later.

  • User profile image
    z33driver

    Well, I tried opening my SVG drawing in Illustrator and saving as an Illustrator file, and then importing it into ZAM 3D, rotating my drawing, and then exporting to XAML.  While it looks kind of cool because ZAM 3D "extrudes" my 2D floorplan, it generates a 51MB XAML file!  XAMLPad chokes on it, and Xamlon's XamlViewer throws exceptions (I think Xamlon only supports the earlier Avalon spec circa 2003).  So I'm still searching for an easy way to take my 2D drawing that is working in Xamlon, and rotate it so I can get a perspective view.  I guess I can write a utility to convert all of my Lines to 3d meshes, but then there are Paths etc., so this will only get me a portion of my drawing.

  • User profile image
    wacko

    I am pretty sure atleast I recall seeing that you can create just a basic mesh like a Cube or something like that and then place a material on it.... like an Image or something like that. The thing about ZAM 3D is it coverts everything into XAML so the files tend to be big, but I am pretty sure you can place the image on a mesh like a cube or something.

    EDIT: So you want to have your walls raised? so you can see the floor plan in full 3d ?

  • User profile image
    z33driver

    I don't want to rasterize my 2D drawing and use it as a material, because then I lose the ability to smoothly zoom in and out on the drawing and still have it look good.

  • User profile image
    wacko

    I wonder maybe if you can throw the content of a XAML file on a 3D Surface.... I mean you could get Mike Swansons Illustrator to XAML exporter and then maybe display the content of a XAML file on the 3D surface using a frame or something ?

  • User profile image
    z33driver

    That is what I am trying to do!  I have Mike Swanson's exporter, as well as the Xamlon converter.  That is how I made the XAML, I opened my SVG in Illustrator, rescaled the drawing, converted the text to outlines, put everything on 1 layer, and exported it to XAML.  Now I just want to take that XAML and rotate it so I get a 3d perspective view and then plot some stuff on it.  I want the end user to be able to click-and-drag the drawing with the mouse and rotate it around, etc.

  • User profile image
    z33driver

    I was thinking about this some more, and I'm wondering how they did it in Sparkle.  Watching the Sparkle video, you can see when the app is being demo'd they show how you can select something and you get the X,Y,Z axis that you can then grab and rotate.  Is Sparkle automatically converting 2D things into Meshes for the user?

  • User profile image
    Tyler Brown

    I believe all that is being done is something rather simple. A 3D mesh is created, but its a single surface. An image is then applied to the surface, which takes the shape of the 3D mesh. This is how it was explained for the Avalon demo from a while back displaying all the XBox games. It showed each XBox game title in the list box, and each list box item as a Viewport3D which contained the same brush, but with different surfaces.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.