For bugs and new features, use the issue tracker located at GitHub.
Also try the chat room!

How to tell TextVisual3D dimensions

MeshBuilder Revolve WPF Lines
mcrxb wrote at 2012-01-18 18:43:
Hello,
Is it possible to use MeshBuilder to create a revolved mesh from WPF lines and arcs?
Thank you!
objo wrote at 2012-01-18 18:50:
see the AddRevolvedGeometry method:
public void AddRevolvedGeometry(IList<Point> points, Point3D origin, Vector3D direction, int thetaDiv)
mcrxb wrote at 2012-01-23 13:24:
Thanks for the quick reply. I was wondering, though, if I could take a WPF object like Path and revolve that. If not, do you have a small sample app that utilizes MeshBuilder for creating revolves? I couldn't find any uses in the sample applications.
Thank you.
objo wrote at 2012-01-26 20:07:
Most of the Visual3D classes in the toolkit is using the MeshBuilder to generate the geometry. See the ArrowVisual3D.Tesselate() method (using an AddArrow method that again uses AddRevolvedGeometry).
No, the revolve method is not accepting Path objects (this would be more work to support all the different path segment types), it just takes a simple list of points.

Camera view of rectangles
I am new to 3d manipulation esp with helix toolkit.
Am trying to have a camera fixed to a side of rectangle. When the rectangle is rotated or moved, the camera should relatively change it's view. Is there any property that ties the camera to an object or a specific vector of an object? Also, there will be 2 rectangles used as planes intersecting making an 'X' shape from the top view. So there has to be 2 views of one side of each plane and a top view.
I am looking forward to understand a way to make this work.Thanks!

Display the 3D mesh
kirru wrote at 2013-11-16 10:06:
I loaded the .obj file into WPF visual c# application, now the issue is how to display the mesh generated by that .obj file using Helix tiilkit. Any help is appreciated.
objo wrote at 2013-11-19 22:27:
See Source\Examples\SimpleDemo and Source\Examples\ModelViewer and http://www.nudoq.org/#!/Packages/HelixToolkit/HelixToolkit.Wpf/ObjReader

Two questions on Manipulator
damianoslebo wrote at 2013-02-12 01:36:
CubeVisual3D box = new CubeVisual3D();
box.Center = new Point3D(x, y, z);
CombinedManipulator boxManipulator = new CombinedManipulator();
boxManipulator.Position = box.Center;
boxManipulator.Pivot = box.Center;
boxManipulator.CanRotateX = false;//true;
boxManipulator.CanRotateY = false;// true;
boxManipulator.CanRotateZ = false;// true;
boxManipulator.CanTranslateX = false;// true;
boxManipulator.CanTranslateY = false;// true;
boxManipulator.CanTranslateZ = true;
boxManipulator.Bind(box);
vp.Children.Add(boxManipulator);
vp.Children.Add(box);
globalManipulatorList.Add(boxManipulator);
I can get the manipulator to work in the x and y and all rotation directions, however the Z translate direction does not show up on the viewport. I don't know why the other directions work but Z does not work.The second question is what event can invoke when using a transparent bounding volume to detect a mouse left button down on the manipulator? I have been using the VisualTreeHelper.HitTest method to ignore transparent geometry before now but I don't know what method can be invoked once a manipulator is found by the VisualTreeHelper.HitTest method.
Thanks for the help,
Damian
objo wrote at 2013-03-12 11:41:
1: Thanks for the notice - I see some change had broken the TranslateManipulator. I removed the default value of the Direction property, now it seems to work again.
2: Sorry, I don't quite understand the problem here. Please make an example that we can debug!

Manipulators to stretch and move box
christianw42 wrote at 2013-06-17 14:03:
i have a little problem with adding manipulators to an visual via code, in my case a BoxVisual3D.
I define a box an two manipulators, one for moving, one for resizing:
var volumeBox = new BoxVisual3D();
volumeBox.Center = new Point3D(0, 0, 0);
volumeBox.Length = 0.3;
volumeBox.Width = 0.3;
volumeBox.Height = 0.3;
volumeBox.Material = MaterialHelper.CreateMaterial(Colors.SkyBlue, 0.3);
var xManipulator = new TranslateManipulator();
xManipulator.Color = Colors.Red;
xManipulator.Length = 0.4;
xManipulator.Diameter = 0.02;
xManipulator.Position = new Point3D(0, 0, 0);
xManipulator.Direction = new Vector3D(-1, 0, 0);
xManipulator.Offset = new Vector3D(-1, 0, 0);
xManipulator.Bind(volumeBox);
var xStretchManipulator = new TranslateManipulator();
xStretchManipulator.Color = Colors.SpringGreen;
xStretchManipulator.Length = 0.3;
xStretchManipulator.Diameter = 0.02;
xStretchManipulator.Position = new Point3D(0, 0, 0);
xStretchManipulator.Direction = new Vector3D(-1, 0, 0);
xStretchManipulator.Offset = new Vector3D(0, 0, 0);
//xStretchManipulator.Bind(volumeBox);
var binding = BindingOperations.SetBinding(
xStretchManipulator, TranslateManipulator.ValueProperty, new Binding("Length") { Source = volumeBox, Converter = new LinearConverter { M = 0.5 }});
binding.UpdateTarget();
//var targetBinding = BindingOperations.SetBinding(
// xStretchManipulator, TranslateManipulator.TransformProperty, new Binding("Transform") { Source = volumeBox });
//targetBinding.UpdateTarget();
//var targetTransformBinding = BindingOperations.SetBinding(
// xStretchManipulator, TranslateManipulator.TargetTransformProperty, new Binding("Transform") { Source = volumeBox });
//targetTransformBinding.UpdateTarget();
The code above works fine for resizing and moving the box, but the manipulator for resizing (xStretchManipulator) does not move with the box. When I add the transform-bindings to the xStretchManipulator, it moves with the box, but position is always in the
center of the box and when you stretch to much, manipulator is inside the box. Does anyone have an idea how to define and bind the manipulators, so that it works correctly?
Thanks a lot for any help or ideas!
christian

Monster memory leak on window resize for SharpDX build.
noemata wrote at 2014-03-19 20:28:
Strangely the leak appears to accumulates on a TextBlock control.
objo wrote at 2014-04-29 10:52:

Simple sample to make objects in code
mentalarray wrote at 2012-03-27 03:13:
Hi well done for such a great project...
I just wondred whethr there is a sample to add/make objects from scratch in code, i have seen the Mvvm demo but was interested in another more simpler way
Much thanks...
murray_b wrote at 2012-03-27 05:21:
How simple?
In the MVVM example it creates a observable collection
�public ObservableCollection Objects { get; set; }
Binds it to the itemsource of the Viewport
then adds objects to it in code. Ie Objects.Add( new #any of the Visual3d objects#)
objects.add (new TubeVisual3D { Path = polygonPoints, Material = MaterialHelper.CreateMaterial(tubeColor), BackMaterial = MaterialHelper.CreateMaterial(tubeColor), Diameter = 0.1 });
Does that help? Let me know if that doesn't make sense
or do you want a non-mvvm. If so just add objects in code behind to the itemsource
mentalarray wrote at 2012-03-27 17:20:
Oh brill thanks murray_b just what i needed

Port to Winform and SharpGL?
tingspain wrote at 2013-04-25 02:55:
First of all, I would like to say that GREAT JOB. I have checked the demo apps and it is very impresive work.
I was wondering if it is possible to easy port this library to Winform and SharpGL?
I dont know too much about WPF.
Thanks in advance.
objo wrote at 2013-04-25 11:31:
Sorry, there are no plans to port to Windows forms and OpenGL.
RobPerkins wrote at 2013-04-25 18:07:
przem321 wrote at 2013-04-25 23:16:
objo wrote at 2013-04-26 00:01:
Keep up the good work on the sharpdx fork, Przem!
tingspain wrote at 2013-04-26 01:02:
I looked around very fast the source code of Helix 3D toolkit, and I found get my lest a little lost. I am not familiar with WPF. Do you think that it will be very hard to port to Winform + SharpGL or SharlpDX?
Maybe I can start the porting the code.
objo wrote at 2013-04-26 22:19:
tingspain wrote at 2013-04-27 04:38:
objo wrote at 2013-05-08 15:48:
Feel free to start a fork on this! I wish I had time to follow up, but I'm focusing on other tasks at the moment.
RobPerkins wrote at 2013-06-18 19:47:
Does the architecture make sense in terms of Helix?
objo wrote at 2013-06-18 22:20:
I think performance is important for the mesh generating code. I think this means that platform specific data types (e.g. point, quaternions, transformations) should be used as much as possible, but it is possible that the platform specific data types do not need to be exposed in the public interfaces.
RobPerkins wrote at 2013-06-18 23:16:
namespace ExtensionMethods
{
public static class MyExtensions
{
public static int WordCount(this String str)
{
return str.Split(new char[] { ' ', '.', '?' },
StringSplitOptions.RemoveEmptyEntries).Length;
}
}
}
Which is then used by declaring using ExtensionMethods
and:string s = "Hello Extension Methods";
int i = s.WordCount();
I note that you have four such classes in the code base which I have (privately) forked for my own use.
What strikes me as interesting is that almost every 3D implementation uses a unique type name for its points, quaternions, and transformations, but the actual structure of the structs or class data have to be identical or nearly so. For games, performance of mesh generators is not vital; under the only architectures I can think of, most of those are loaded or preloaded before a high framerate is needed in the game. For engineering use cases, a high triangle count plus a relatively low framerate (mouse gesture animations, mostly) are the order of the day.
Frankly, for most mesh generation, I'm writing my own code against my data models and emitting the WPF formatted arrays and assigning them to the various Visual3Ds I use from the Helix library. So what I'm thinking about is extension methods like "ToOpenGL--structure--" or "ToSharpDX--whatever--" which would take the WPF structures native to Helix and emit the ones compatible with the other libraries. With a modern i5 or i7 and TPL it wouldn't even be computationally time consuming to execute such functions unless the facet counts were in the millions.
For my engineering based low-frame-rate, medium-delay-tolerant use cases, such an approach would not be so bad. I may give this more thought; the OpenTk stuff looks very, very compelling for non-WPF reasons.
Customer support service by UserEcho