The following code:
<Window x:Class="helixCube.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:h="http://helix-toolkit.org/wpf"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:helixPerfectCube"
mc:Ignorable="d"
Title="MainWindow" Height="350" Width="525">
<Grid Width="200" Height="200" Background="Red">
<h:HelixViewport3D Title="Titlee" ShowViewCube="False" TextBrush="Black" Opacity="0.9">
<h:SunLight/>
<h:BoxVisual3D Width="12" Length="12" Height="12"/>
</h:HelixViewport3D>
</Grid>
</Window>
gives me the following cube:
I would like to make the following 2 changes:
I want the color of the cube to be black. However, I can't find a way to do this.
I want the title to be displyed directly on (the surface of) the cube.
Does anybody know how this can be done?
In viewmodel, Create some materials as follows:
Create a cube object.! (cubeObj) After that
In Ui,
Helix ViewPort allows rotation, pan and zoom. text doesn't render neatly in such 3d space while performing above actions. Hence, it isn't recommended to put text on top of the cube.
Disclaimer: Untested code.!