Scichart如何将obj文件添加到3D界面中

huangapple go评论90阅读模式
英文:

How does scichart add obj files to 3D interface

问题

如何将.obj文件添加到3D界面中?

在上述代码运行之后,OBJ对象在3D界面中不可见。

为什么我按照官方示例程序添加了.obj文件,但它不起作用?

你能否提供官方示例之外的示例?

英文:

How does scichart add obj files to 3D interface ?

Scichart如何将obj文件添加到3D界面中

Scichart如何将obj文件添加到3D界面中

<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>

</Window>
`

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?

答案1

得分: 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:

We have also created a custom example demonstrating how 3D objects can be added in XAML and via StreamSource. Here is a link:

Please try it out and let us know your feedback.

With best regards,
Lex,
SciChart Technical Support Engineer"

英文:

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

huangapple
  • 本文由 发表于 2023年2月23日 22:49:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/75546428.html
  • scichart
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定