0

VRML Importer version

Anonymous 10 years ago 0
This discussion was imported from CodePlex

michaeldjackson wrote at 2012-11-19 16:48:

If I download the latest version Oct 2012, will it containthe VRML importer feature? If not, how do I get the version with VRML importer?


objo wrote at 2012-11-19 16:58:

You find the vrml import fork on http://helixtoolkit.codeplex.com/SourceControl/network/forks/glgweeke/vrmlImport

This fork has not been merged into the default branch yet.


michaeldjackson wrote at 2012-11-19 18:35:

I'm trying to import a simple wrl model using the VRML reader. It fails with the following exception:

System.FormatException was unhandled
  HResult=-2146233033
  Message=Input string was not in a correct format.
  Source=mscorlib
  StackTrace:
       at System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt)
       at System.Double.Parse(String s, IFormatProvider provider)
       at HelixToolkit.Wpf.VrmlReader.GetValues(Double[]& result)
       at HelixToolkit.Wpf.VrmlReader.ReadGeometry(Model3DGroup model3DGroup)
       at HelixToolkit.Wpf.VrmlReader.DoShapeNode(Int32 level, Model3DGroup model3DGroup)
       at HelixToolkit.Wpf.VrmlReader.ReadTransform(Model3DGroup model3DGroup, Int32 level)
       at HelixToolkit.Wpf.VrmlReader.DoGroupNode(Int32 level, Model3DGroup model3DGroup)
       at HelixToolkit.Wpf.VrmlReader.ReadTransform(Model3DGroup model3DGroup, Int32 level)
       at HelixToolkit.Wpf.VrmlReader.Read(Stream s)
       at HelixToolkit.Wpf.VrmlReader.Read(String path)
       at VRMLImportTest.MainViewModel.LoadModel() in c:\CPG Dev Projects\VRMLImportTest\VRMLImportTest\MainViewModel.cs:line 26
       at VRMLImportTest.MainWindow.btnRun_Click_1(Object sender, RoutedEventArgs e) in c:\CPG Dev Projects\VRMLImportTest\VRMLImportTest\MainWindow.xaml.cs:line 42
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
       at System.Windows.Controls.Primitives.ButtonBase.OnClick()
       at System.Windows.Controls.Button.OnClick()
       at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
       at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
       at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
       at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
       at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
       at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
       at System.Windows.Input.InputManager.ProcessStagingArea()
       at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
       at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
       at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
       at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.Run()
       at System.Windows.Application.RunDispatcher(Object ignore)
       at System.Windows.Application.RunInternal(Window window)
       at System.Windows.Application.Run(Window window)
       at System.Windows.Application.Run()
       at VRMLImportTest.App.Main() in c:\CPG Dev Projects\VRMLImportTest\VRMLImportTest\obj\Debug\App.g.cs:line 0
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException:


glgweeke wrote at 2012-11-20 08:16:

Hi,

can you add your .wrl file?

Thanks!


michaeldjackson wrote at 2012-11-20 12:58:

Not sure how to attach file to reply.


glgweeke wrote at 2012-11-21 11:34:

Hi,

you can create a new issue and attach a file.

Max. 4MB. (use Zip)


objo wrote at 2012-11-21 11:55:

I would suggest sharing by a service like
http://www.filedropper.com
http://www.filefactory.com
http://fileden.com/ 

or for source files
http://pastebin.com
etc. 


michaeldjackson wrote at 2012-11-21 13:37:

Link to my troublesome .wrl file.

http://www.filefactory.com/file/6lpoznkjny8d/n/AF1_wrl

The AF1.wrl file is an export from Flac3D 5.0 from Itasca, and represents a rectilinear grid.

I used MeshLab (free, opensource) to view the file to ensure it is not corrupted.


glgweeke wrote at 2012-11-21 22:04:

In the vrml import fork i make some bugfixes. Now you can import the file.

Currently i do not support texture mapping.

But it will be possible to add this feature in near future.


michaeldjackson wrote at 2012-11-29 19:50:

I have uploaded a .png to http://www.filefactory.com/file/5dmq1jc0ulgv/n/VRMLInMeshLab_PNG which represents the AF1.wrl file that I sent you previously for your testing purposes being viewed in MeshLab. Is is possible to get this type of view from your VRML importer? In MeshLab, this view is obtained by clicking the "WireFrame" button.


glgweeke wrote at 2012-12-04 18:39:

Hi,

in WPF it is not possible to draw a real line in 3D.

Your .WRL-File is using IndexedLineSet which need this feature.

This Helix-Toolkit creates a line with 2 Triangles which what a real size. Not only one pixel on every viewpoint.

To do what you like, 

pease patch the following to lines in the VRMLReader.cs file.

1.) Line 734: 

            if (FindNode("IndexedFaceSet"))

replace 

if (false)

 

2.) Line 949:

                    mesh.Positions = lg.CreatePositions(linePoints, 0.001);

replace

                    mesh.Positions = lg.CreatePositions(linePoints, 0.1);

 

This importer is not stable not finished and not perfect.