+1

Viewport2DVisual3D

Anonymous 10 years ago updated by ไอยดา สุรีวงค์ 4 years ago 3
This discussion was imported from CodePlex

DuaneTNM wrote at 2011-08-25 03:21:

Are there any examples showing Viewport2DVisual3D with HelixView3D.  Can this type of 2D on 3D be achieved with the HelixToolKit.

 

Thanks


objo wrote at 2011-08-25 07:44:

Hi DuaneTNM, sorry there is no example using Viewport2DVisual3D. But I don't think there should be any problem to use it with the controls in HelixToolkit! 


mipa87 wrote at 2011-08-30 17:42:

First, thank you for this project.

How can I use common WPF controls (buttons, sliders) with this toolkit (with supporting button click, slider value changed and etc.)? I'm using Viewport2DVisual3D for this, render is ok, but events are not triggered. What I'm doing wrong?

Thanks

Here is my code:

             <helix:HelixView3D IsHeadLightEnabled="True" ZoomToFitWhenLoaded="True" ShowFrameRate="True" ShowFieldOfView="True" ShowCoordinateSystem="True" MouseDown="HelixView3D_MouseDown" Name="helixView3D" IsHitTestVisible="true">
                <helix:HelixView3D.Camera>
                    <PerspectiveCamera Position="0, 0, 4"/>
                </helix:HelixView3D.Camera>
                <ModelVisual3D>
                    <ModelVisual3D.Content>
                        <Model3DGroup x:Name="group">
                            <DirectionalLight Color="White" Direction="-1, -1, -3" />
                        </Model3DGroup>
                    </ModelVisual3D.Content>
                    <Viewport2DVisual3D>
                        <Viewport2DVisual3D.Geometry>
                            <MeshGeometry3D Positions="-1,1,0 -1,-1,0 1,-1,0 1,1,0"
TextureCoordinates="0,0 0,1 1,1 1,0" TriangleIndices="0 1 2 0 2 3"/>
                        </Viewport2DVisual3D.Geometry>

                        <Viewport2DVisual3D.Material>
                            <DiffuseMaterial Viewport2DVisual3D.IsVisualHostMaterial="True" Brush="White"/>
                        </Viewport2DVisual3D.Material>
                        <Viewport2DVisual3D.Visual>

                            <StackPanel Orientation="Vertical">
                                <Button Click="Button_Click">Button</Button>
                                <Slider Value="100" ValueChanged="Slider_ValueChanged" />
                            </StackPanel>
                        </Viewport2DVisual3D.Visual>
                    </Viewport2DVisual3D>
                </ModelVisual3D>
            </helix:HelixView3D>


objo wrote at 2011-08-31 20:36:

I think this is related to issue 8172, and it is not solved yet...

http://helixtoolkit.codeplex.com/workitem/8172


mipa87 wrote at 2011-09-01 00:06:

Thanks for the reply, I solved it with IsViewportHitTestVisible="True"

Here is good article about it: http://msdn.microsoft.com/en-us/library/ms752097.aspx

I have one another question, what's the difference between HelixView3D and ViewPort3DConrtroller?

And here is my working code:

<helix:HelixView3D IsViewportHitTestVisible="True">
	<helix:HelixView3D.Camera>
		<PerspectiveCamera LookDirection="-10,-10,-10" Position="10,10,10" UpDirection="0,0,1"/>
	</helix:HelixView3D.Camera>
	<helix:DefaultLightsVisual3D/>
	<ModelVisual3D>
		<Viewport2DVisual3D >
			<Viewport2DVisual3D.Transform>
				<RotateTransform3D>
					<RotateTransform3D.Rotation>
						<AxisAngleRotation3D x:Name="uiRotate" Angle="40" Axis="0, 1, 0" />
					</RotateTransform3D.Rotation>
				</RotateTransform3D>
			</Viewport2DVisual3D.Transform>
			<Viewport2DVisual3D.Geometry>
				<MeshGeometry3D Positions="-1,1,0 -1,-1,0 1,-1,0 1,1,0"
TextureCoordinates="0,0 0,1 1,1 1,0" TriangleIndices="0 1 2 0 2 3"/>
			</Viewport2DVisual3D.Geometry>
			<Viewport2DVisual3D.Material>
				<DiffuseMaterial Viewport2DVisual3D.IsVisualHostMaterial="True" Brush="White"/>
			</Viewport2DVisual3D.Material>
			<Viewport2DVisual3D.Visual>
				<StackPanel Orientation="Vertical">
					<Button Background="Yellow" Click="Button_Click">Button1</Button>
					<Slider Value="100" ValueChanged="Slider_ValueChanged" />
				</StackPanel>
			</Viewport2DVisual3D.Visual>
		</Viewport2DVisual3D>
	</ModelVisual3D>
</helix:HelixView3D> 

objo wrote at 2011-09-14 09:24:

try the newest version of the library, hopefully the fix on UIElements works.

Note that HelixView3D is renamed to HelixViewport3D and the IsViewportHitTestVisible property is removed.


mipa87 wrote at 2011-09-27 19:33:

Thanks, it works now correctly!

I would like to thank you for the efforts you have made in. The game is best known for its dark sense of humor and its graphic violence . I am hoping the same best work from you in the future as well. I really appreciate your work. Thanks for you agree for me. geometry dash  happy wheels  dumb ways to die   fireboy and watergirl 4.