visualize coordinate axes of world system in WPF 3D - c#

I am currently playing around with WPF 3D. I allready got a cube in my application. Now I want to visualize the coordnate axes of the world system. It should look like a coordinate system on paper with lines res. columns as axes like for example the arrows in blender.
Thank you for your help

I can't recommend Helix 3D toolkit enough. It is a comprehensive toolkit for developing 3D WPF applications.
If you are worried that using a toolkit will reduce your discovery of 3D or you will somehow loose control of how you want to do things then I think you will be pleasantly surprised that it actually accelerates your learning and you are in total control.
The current home of Helix3D is on GitHub (also available on NuGet).
Download the source. In the source folder there is HelixToolkit.Wpf.sln which includes a sub project holding all the examples. If you compile the examples sub-project and run it you are presented with >30 really useful examples.
Here is a screenshot of the example browser running that has a demo of what you are asking for; 3D grid with x,y,z vectors at the origin.

Related

3D container and viewer control for WPF

Recently I have been working on a small WPF project involving the visualization and manipulation of 3d objects. For 2d ojects, this can be easily achieved with a Canvas warpped in a ViewBox or some nice 3rd party controls. But I can't find any free, ready-to-use solution for 3d objects. There is a likely one in WpfToolKit from XceedSoftware(https://github.com/xceedsoftware/wpftoolkit), but no information is given.
I know WPF has some 3D support, like ViewPort3D and other classes in Media3D namespace, and I did find a book, '3D Programming for Windows'(http://www.charlespetzold.com/3D/index.html), by Charles Petzold introducing the concept and basic knowledge. However, many tricky tasks like adjusting camera according to mouse and keyboard input is not presented. So before I start building my own control, I want to at least confirm that I'm not wasting my time doing something already perfectly done. And how to properly config the mouse and keyboard events to make the control behaves as if using some professional CAD softwares?
In short:
1.Any free 3d control for WPF
2.How to build my own ones
Can anyone help me?

Best approach for 2D gesture recognition in VR?

I'm the developer on a game which uses gesture recognition with the HTC Vive roomscale VR headset, and I'm trying to improve the accuracy of our gesture recognition.
(The game, for context: http://store.steampowered.com//app/488760 . It's a game where you cast spells by drawing symbols in the air.)
Currently I'm using the 1 dollar algorithm for 2D gesture recognition, and using an orthographic camera tied to the player's horizontal rotation to flatten the gesture the player draws in space.
However, I'm sure there must be better approaches to the problem!
I have to represent the gestures in 2D in instructions, so ideally I'd like to:
Find the optimal vector on which to flatten the gesture.
Flatten it into 2D space.
Use the best gesture recognition algorithm to recognise what gesture it is.
It would be really good to get close to 100% accuracy under all circumstances. Currently, for example, the game tends to get confused when players try to draw a circle in the heat of battle, and it assumes they're drawing a Z shape instead.
All suggestions welcomed. Thanks in advance.
Believe me or not, but I found this post two months ago and decided to test my VR/AI skills by preparing a Unity package intended for recognising magic gestures in VR. Now, I'm back with a complete VR demo: https://ravingbots.itch.io/vr-magic-gestures-ai
The recognition system tracks a gesture vector and then projects it onto a 2D grid. You can also setup a 3D grid very easily if you want the system to work with 3D shapes, but don't forget to provide a proper training set capturing a large number of shape variations.
Of course, the package is universal, and you can use it for a non-magical application as well. The code is well documented. Online documentation rendered to a PDF has 1000+ pages: https://files.ravingbots.com/docs/vr-magic-gestures-ai/
The package was tested with HTC Vive. Support for Gear VR and other VR devices is progressively added.
Seems to me this plugin called Gesture Recognizer 3.0 could give you a great insight on what step you should take
Gesture Recognizer 3.0
Also, I found this javascript gesture recognition lib in github
Jester
Hope it helps.
Personally I recommend AirSig
It covers more features like authentication using controllers.
The Vive version and Oculus version are free.
"It would be really good to get close to 100% accuracy under all circumstances." My experience is its built-in gestures is over 90% accuracy, signature part is over 96%. Hope it fits your requirement.

How to implement rigid body dynamics previewed by WPF 3D

I'm currently facing a problem with WPF 3D using C#. To put it simple, I need to animate some simple mechanical part by only moving two of them (one at a time or both together). Here is a simple drawing depicting the situation :
So by moving (translating) vertically P1 or/and P2 parts, the whole thing needs to move accordingly.
I guess it may be possible to do by computing a lot of angles and applying numerous transformations but this is not my goal.
Therefore I would imagine something like attaching the parts together by the means of a pivot point.
What is the preferred way to do this to preview it using WPF 3D?
WPF 3D, Ogre, Mogre, OpenTK... are libraries for display. They have nothing to do with mechanical constraints calculations. But they goes well with physics engines.
WPF 3D is a subset of WPF dedicated to 3D drawing. If you need 2D, then WPF is enough.
As your project looks 2D, you might want to have a look to Farseer Physics which is a port of Box 2D. The feature you need is called joints. Both libraries target 2D games development, but they can be used for simple kinematics animations, and Farseer Physics is doing very well with WPF.
It's a simple problem for any 2D kinematics package.
http://books.google.com/books?id=IGtIWmM2GWIC&pg=PR12&lpg=PR12&dq=c%23+kinematics&source=bl&ots=eCJZLq_i6R&sig=wC42cNOdtw4VX9ElTk4IBDAYtzc&hl=en&sa=X&ei=3YkXU4u1EeHu2wXum4GYDA&ved=0CFsQ6AEwBQ#v=onepage&q=c%23%20kinematics&f=false

Web Page - 3d earthquake visualization - Silverlight?

I have never written any silverlight apps but I am looking to write a 3d viewer for earthquakes and have it run from my web site.
I would like to create a simple viewer so the user can change the "camera" ie their perspective. The view could contain up to 10,000 objects in the 3d space.
I want the ability to quickly view this - I have seen this on a Power Basic application and want to do this for the web.
I have a current web site at http://canterburyquakelive.co.nz for earthquakes in Canterbury New Zeaalnd and I want to learn the basics so that it can be more interactive.
I want to say for example (to start) place 2 objects in a "space" that I can define and move the camera in real time.
The system must support up to 10,000 objects in the end of the day.
Each object can be a simple circle - no need for special pixel shaders
I am unsure of the exact functionallity of the system at the moment so if I can find a tutorial that allows me to place someone (a circle) into a 3d world (space) and change the camera that would be good.
Any ideas appreciated - there seems to be so much about 3d and silverlight that I may be getting lost in the "gloss" of new features where I need some basics and I can learn and adapt over time.
** Added comment + image **
Basically I am waiting to create a page that look like this using Silverlight. But I am open to any technology.
I've never done 3D in silverlight so I can't exactly answer your question as asked but in general to display geographic markers in a 'real' 3D terrain is quite involved. At a minimum you're probably looking at:
Obtaining binary height data files (last time I looked, NASA gives this away)
Reading and interpreting said files to get 'bitmap' height data
Choosing and dealing with projections (e.g. UTM)
Deciding how to tesselate your bitmap height data
If you want it textured you'll need to also obtain satellite data for that, again converting or processing it to account for projection.
You could ignore the terrain height, but that may not simplify things depending on how 'bumpy' your terrain is.
For a pre-defined small enough area, you could perhaps pre-author a 3d model of the terrain in some 3D package but displaying your markers will still require a projection from long/lat into your 3D space, and you'll still need to know terrain height (unless you do mesh collision with the static model).
Rendering the markers is pretty straightforward by comparison, choose from:
Use a 3D model e.g. a 'pin head' (simple but not always visible)
Render a regular n-gon with 'viewer facing' polygons (resolution independent but maybe ugly)
Render a quad with a circle texture on it (low poly but what size texture to choose?)
There are probably libraries that do some or all of this for you, so if you are set on rolling your own then some of the things I've mentioned could form the basis for your search.
However, given what you've described of your site and situation I suspect you'd be better off avoiding all that work by using a pre-existing solution. E.g. the Google Earth API.
You could consider 3D web plugins that -granted- take you away from Silverlight but that might speed up your development process. I'm thinking in particular of e.g. the Blender 3D web plugin. I can understand the need to write your own viewer, but think twice before you re-invent the wheel. Good luck!

SIMPLE 3D rendering in C#

I am a visual person, if I can visualize something it often makes more sense to me.
Is there a simple way to render data in 3D to use for simple visualizations? What I effectively would like to do is the following:
I have a 3 dimensional Array of Int32's:
Int32[,,] data = new Int32[256,256,256];
I fill this array with data, and would basically want to now render this in a 3D space. X, Y and Z and place a dot where the data is greater than 0. Basic
Being able to change the viewing angle would be a bonus, but not essential.
I have not looked into 3D rendering enough to make use of any of the real 3D engines out there, so the simpler the better.
Any help, pointers would be nice.
Thanks
WPF (Windows Presentation Foundation, included in .net 3.5) makes 3D rendering quite easy (or at least easier than it was before). Have a look at the following tutorial:
http://www.kindohm.com/technical/WPF3DTutorial.htm -- original link is dead, but the article can still be found at archive.org, http://web.archive.org/web/20131122141342/http://kindohm.com/technical/WPF3DTutorial.htm
It shows how to create a small 3D viewport and position simple elements inside.
Microsoft .Net Chart Control - download here. It's like using the 3D charting in Excel.

Categories

Resources