Click or drag to resize

VisualRotate(Visual, Axis, SpeedProfile) Method

Set the visual rotating.

Namespace: Demo3D.Visuals
Assembly: Demo3D.Core (in Demo3D.Core.dll) Version: 19.00.00
Syntax
C#
public void Rotate(
	Visual targetVisual,
	Axis axis,
	SpeedProfile speedProfile
)

Parameters

targetVisual  Visual
The rotation wil be relative to this visuals rotational coordinates. (The rotation will not be around this visual, but on the spot, using this visual's axis).
axis  Axis
The axis around which to rotate.
speedProfile  SpeedProfile
The speed profile to be used to rotate.
Example
C#
// This example will rotate a visual (sender) around the Y axis of visual target1 when clicked,
// at a speed of 360 degrees per second (1 revolution per second), after accelerating to this speed
// at 180 deg/s^2. The deceleration component of the speed profile is not used.
[Auto]
SimpleVisualPropertyValue<Visual> target1;

[Auto("OnClick")]
void RotateVASp_OnClick(Visual sender, PickInfo pickInfo)
{
    var speed = new SpeedProfile(360, 180, 10);
    sender.Rotate(target1.Visual, Axis.Y, speed);
}
See Also