I think the proper way of syncronising the surfaces is using "Direct3D9Ex and DXGI Shared Surface Queue":
in the docs for the queue,
in chapter Interoperability between Direct3D 9Ex and DXGI based APIs here Surface Sharing Between Windows Graphics APIs (Windows)
Unity - not unlike some other game engines - provides as the backbone of its architecture a scene-graph that unifies all aspects of the MVC / MVVM triad. Trying to work around such fundaments of the platform will only cost you more in time than you think you might gain by adapting it to the architectural paradigm you mention... rest assured.
Re your ...
I've spent a lot of time worrying about WPF performance and animations when writing the WPF Mind Mapping app NovaMind.
On Stackoverflow I've written down some WPF animation best practices. Maybe those can help you.
Regarding your question:
I've experimented with DoubleAnimation and ThicknessAnimation both enable movement of the character, but the speed ...
I can't provide you with the code solution, but here's some formulas you might find useful to do it yourself:
Calculate eyeball position:
position = normalize(food_piece - head_center) * head_radius
unit_vector = vector / length(vector)
be careful not to divide by zero here, so check length before performing division
If there is no roll in your FPS camera (typically, there is not in an FPS) then all you need to do to get a yaw angle (-π..π ) from the vector is the atan2() function.
As suggested by DMGregory, the arcsin of the z component of the forward vector gives the tilt angle.
// calculate yaw
const float yaw_angle = atan2f( cam_fwd.y, ...
Did you solve this? D3DImage only works with Direct3D 9Ex surface so it won't work with DXGI/Texture2D which are Direct3D 11... unless you arrange some very tricky DXGI surface sharing between 11 -> 9Ex in advance. I have all the numerous code fragments that prove this should be possible (i.e. accelerated Direct3D 11 video pipeline targeting WPF) but have ...
With WPF, the UI ( or render I guess ) thread is kind of special. It'll try and run every 60th of a second. All of your View->ViewModel bound property read/writes are sort of banked up and updated on the UI thread. So you can alter a property a ton of times on a background thread but it will be updated on the UI thread. Command bindings ( like a button click ...
Admittedly, this is an educated guess, so keep that in mind;
WPF being the parent domain in this case means that all subprocesses like the XNA game are issued handles from that domain. I don't really know enough about the architecture behind WPF to adequately explain what it would be doing to cause the slowdown. However, as a possible fix, try automatically ...
I had to ask a friend that is good at 3D graphics this is what he did to make it right:
ProjectionCamera camera = (ProjectionCamera) viewport.Camera;
Vector3D ax1 = camera.LookDirection.Normalized();
Vector3D ax2 = Vector3D.CrossProduct(ax1, camera.UpDirection).Normalized() * -1;
Vector3D ax3 = camera.UpDirection.Normalized();
Vector3D translation = (ax1*...
Since you're using WPF I expect you don't plan to use a lot of animation, so a better way to do this would be with a Grid:
<!-- XAML -->
I am guessing you are using System.Draw methods to draw the rectangles (I hope you are not drawing labels or something cause that would kill performance). I would make a mouse down event on the form, and then use the mouse position value to get the rectangle that was clicked depending on the width/height of them.
So say the user clicks at 250,250 and the ...