• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Animation in DirectX

Luis_Sá

Resource contributor
Messages
326
Country
portugal
Hello,

I am sorry for this question that is not directly related to FS but I imagine that many designers and tool developers coming here could easily clarify me.

I want to build a windows application (using dot net and managed DirectX9) to animate an object. I have several .X files (about a dozen), each one storing a mesh of the object in a particular take (I think I can call these keyframes - the meshes have the same number of points and faces). My application will load those meshes and then, after some user input, a time line is defined to control the animation. I know how to render the object. My question is related to the generation of intermediate meshes. For example I have mesh_A defined at time T1 and mesh_B defined at time T2. I need to create intermediate meshes along 40 ms intervals that exist between T1 and T2. I found a function that interpolates between corresponding vertices of 2 meshes:

http://books.google.pt/books?id=CE-...stH4Dw&sa=X&oi=book_result&ct=result&resnum=1

but that means that the CPU has to cycle between all the vertex of the 2 meshes to create the intermediate mesh. Is there a more efficient way to accomplish that? I thought there was a chance that GPUs could already do that. :confused:

Many thanks in advance for any tip.

Best Regards, Luis
 
I think you would want to use either a vertex shader or a geometry shader, but I believe geometry shaders are only available in DX10 (and early DX10 hardware sucks for geometry shaders :-> ).

Also the Managed DirectX 9 code is extremely old, and was never really supported even when it was being developed, so you may want to look into using XNA instead.

If you can get by with Shader Level 2.0, you might also be able to use the 3D support in WPF 3.5 (or the beta 4.0), but I haven't played with any of that yet so don't know if it will do what you need or not.
 
I think you would want to use either a vertex shader or a geometry shader, but I believe geometry shaders are only available in DX10 (and early DX10 hardware sucks for geometry shaders :-> ).

Also the Managed DirectX 9 code is extremely old, and was never really supported even when it was being developed, so you may want to look into using XNA instead.

If you can get by with Shader Level 2.0, you might also be able to use the 3D support in WPF 3.5 (or the beta 4.0), but I haven't played with any of that yet so don't know if it will do what you need or not.

Tim

Am I right in thinking that WPF 3.5 supports 3D directly?
 
Tim

Am I right in thinking that WPF 3.5 supports 3D directly?

Yes, it has some support for 3D (and I believe 4.0 adds more, or at least makes it more efficient :-> ), but like I said, I haven't really spent any time playing with that yet myself. You start with a Viewport3D control - here's a link to the online docs that describe the 3D graphics abilities of 3.5: http://msdn.microsoft.com/en-us/library/ms746698.aspx.

I've also seen a few articles on Codeplex.com showing how to do a hybrid solution, using C#/WPF as the main app/UI layer, then using interop to talk to native C++ code that does the heavy DirectX lifting - I was actually planning to look into doing that with the existing FS engine as a self assigned background task before the studio was shut down.
 
Back
Top