2

How does scichart add obj files to 3D interface ?

enter image description here

enter image description here

<Window x:Class="SciChartObjTest.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:SciChartObjTest" xmlns:s3D="http://schemas.abtsoftware.co.uk/scichart3D" xmlns:object="clr-namespace:SciChart.Charting3D.Visuals.Object;assembly=SciChart.Charting3D" xmlns:ext="http://schemas.abtsoftware.co.uk/scichart/exampleExternals"
    mc:Ignorable="d"
    Title="MainWindow" Height="450" Width="800">
<Window.Resources>

    <!--<object:ObjectModelSource x:Key="KingLowObj3DSource" Source="pack://application:,,,/SciChart.Examples.ExternalDependencies;component/Resources/Objects/King_Low.obj"/>-->

    <object:ObjectModelSource x:Key="test" Source="pack://application:,,,/King_Low.obj"/>
    
</Window.Resources>

<Grid>

    <s3D:SciChart3DSurface Name="sciChart3DSurface"
                           Grid.Column="1"
                           BorderThickness="0"
                           WorldDimensions="250,2,250">

        <s3D:SciChart3DSurface.Camera>
            <s3D:Camera3D Position="-400,200,400" Target="0,50,0"/>
        </s3D:SciChart3DSurface.Camera>


        <s3D:SciChart3DSurface.XAxis>
            <s3D:NumericAxis3D DrawLabels="False"
                               DrawMajorTicks="False"
                               DrawMinorGridLines="False"
                               DrawMinorTicks="False"
                               PlaneBorderThickness="0.0"/>
        </s3D:SciChart3DSurface.XAxis>

        <s3D:SciChart3DSurface.YAxis>
            <s3D:NumericAxis3D DrawLabels="False"
                               DrawMajorTicks="False"
                               DrawMinorGridLines="False"
                               DrawMinorTicks="False" 
                               PlaneBorderThickness="0.0"/>
        </s3D:SciChart3DSurface.YAxis>

        <s3D:SciChart3DSurface.ZAxis>
            <s3D:NumericAxis3D DrawLabels="False"
                               DrawMajorTicks="False"
                               DrawMinorGridLines="False"
                               DrawMinorTicks="False" 
                               PlaneBorderThickness="0.0"/>
        </s3D:SciChart3DSurface.ZAxis>

        <s3D:SciChart3DSurface.ChartModifier>
            <s3D:ModifierGroup3D>
                <s3D:ZoomExtentsModifier3D AnimateDurationMs="500"
                                           ResetPosition="-400,200,400"
                                           ResetTarget="0,50,0"/>
            </s3D:ModifierGroup3D>
        </s3D:SciChart3DSurface.ChartModifier>

        <s3D:SciChart3DSurface.SceneObjects>
            <object:ObjectModel3D  Source="{StaticResource test}" Position="0,0,0" CoordinateMode="WorldCoordinates" Scale="1, 1, 1" />

        </s3D:SciChart3DSurface.SceneObjects>
    </s3D:SciChart3DSurface>
</Grid>
`

After the above code is run, OBJ objects are not visible in the 3D interface,

Why did I add the obj file as per the official sample program but it didn't work?

Can you give an example besides the official one?

Dr. Andrew Burnett-Thompson
  • 20,980
  • 8
  • 88
  • 178
  • Looks like a possible bug. Was reported here on scichart forums: https://www.scichart.com/questions/wpf/3d-objects. Have created a task for investigation – Dr. Andrew Burnett-Thompson Feb 23 '23 at 16:19
  • My problem is different, no matter what obj file I add, it doesn't show up, even if I add the chess model from the official example to my program – user13058544 Feb 24 '23 at 01:09

1 Answers1

1

I'm glad to inform you that the issue with adding 3D Objects to SciChart3DSurface has been fixed. You can now add objects both by setting relative URLs to the ObjectModelSource.Source property and using ObjectModelSource.StreamSource. The changes are available in SciChart v7.0.1.27097 and newer. Here is how to get our Nightly builds: https://support.scichart.com/index.php?/Knowledgebase/Article/View/17232/37/getting-nightly-builds-with-nuget

We have also created a custom example demonstrating how 3D objects can be added in XAML and via StreamSource. Here is a link: https://github.com/ABTSoftware/SciChart.Wpf.Examples/tree/SciChart_v7_Dev/Sandbox/CustomerExamples/AddObjectsToA3DChart

Please try it out and let us know your feedback.

With best regards, Lex, SciChart Technical Support Engineer

Lex S.
  • 11
  • 2