Text Rotation Issue
#1
Hi

I have a scene and have placed a 'North' marker at the back of the scene.

When I rotate the scene with the camera, the marker moves as expected, but the text does not face the camera as it rotates.

So, what I have done is but a Y axis rotate on it and set the angle to be the opposite of the camera heading using this markup.

Code:
<!--North Marker-->
                <visuals:CenteredTextVisual3D CenterPosition="0 0 -0.07" TextDirection="1 0 0" UpDirection="0 1 0" FontSize="0.025" TextColor="Green" Text="N">
                    <visuals:CenteredTextVisual3D.Transform>
                        <Transform3DGroup>
                            <RotateTransform3D>
                                <RotateTransform3D.Rotation>
                                    <AxisAngleRotation3D Axis="0,1,0" Angle="{Binding ProjectMissionVM.ActiveProjectMission.SceneCameraHeading, Converter={StaticResource OppositeAngleConverter}, Mode=OneWay}" />
                                </RotateTransform3D.Rotation>
                            </RotateTransform3D>
                        </Transform3DGroup>
                    </visuals:CenteredTextVisual3D.Transform>
                </visuals:CenteredTextVisual3D>

What happens now is that the 'North' text rotates to allways face the camera, BUT losses it's place in the scene, it stays in the same point in space??

What I'm I doing wrong??

Thanks

Jason.

(06-02-2015, 02:52 PM)ZENUAV Wrote: Hi

I have a scene and have placed a 'North' marker at the back of the scene.

When I rotate the scene with the camera, the marker moves as expected, but the text does not face the camera as it rotates.

So, what I have done is but a Y axis rotate on it and set the angle to be the opposite of the camera heading using this markup.

Code:
<!--North Marker-->
                <visuals:CenteredTextVisual3D CenterPosition="0 0 -0.07" TextDirection="1 0 0" UpDirection="0 1 0" FontSize="0.025" TextColor="Green" Text="N">
                    <visuals:CenteredTextVisual3D.Transform>
                        <Transform3DGroup>
                            <RotateTransform3D>
                                <RotateTransform3D.Rotation>
                                    <AxisAngleRotation3D Axis="0,1,0" Angle="{Binding ProjectMissionVM.ActiveProjectMission.SceneCameraHeading, Converter={StaticResource OppositeAngleConverter}, Mode=OneWay}" />
                                </RotateTransform3D.Rotation>
                            </RotateTransform3D>
                        </Transform3DGroup>
                    </visuals:CenteredTextVisual3D.Transform>
                </visuals:CenteredTextVisual3D>

What happens now is that the 'North' text rotates to allways face the camera, BUT losses it's place in the scene, it stays in the same point in space??

What I'm I doing wrong??

Thanks

Jason.

Fixed it!

I set the center point to 0,0,0 and use a translatetransform to set its position in space, it then staying in place and rotates to face the camera!

Code:
<!--North Marker-->
                <visuals:CenteredTextVisual3D CenterPosition="0 0 0" TextDirection="1 0 0" UpDirection="0 1 0" FontSize="0.025" TextColor="Green" Text="N">
                    <visuals:CenteredTextVisual3D.Transform>
                        <Transform3DGroup>
                            <RotateTransform3D>
                                <RotateTransform3D.Rotation>
                                    <AxisAngleRotation3D Axis="0,1,0" Angle="{Binding ProjectMissionVM.ActiveProjectMission.SceneCameraHeading, Converter={StaticResource OppositeAngleConverter}, Mode=OneWay}" />
                                </RotateTransform3D.Rotation>
                            </RotateTransform3D>
                            <TranslateTransform3D OffsetX="0" OffsetY="0" OffsetZ="-0.07" />
                        </Transform3DGroup>
                    </visuals:CenteredTextVisual3D.Transform>
                </visuals:CenteredTextVisual3D>

Hi

How can I rotate the text on the Y axis AND on the X axis at the same time.

This way when the model is tilled up/down the text will tilt and face the camera?

I don't know how to use matrix transform??

Thanks

Jason
  


Messages In This Thread
Text Rotation Issue - by ZENUAV - 06-02-2015, 02:52 PM
RE: Text Rotation Issue - by abenedik - 06-18-2015, 11:05 PM

Forum Jump:


Users browsing this thread:
1 Guest(s)