本文整理汇总了C#中Gradient.AddSegment方法的典型用法代码示例。如果您正苦于以下问题:C# Gradient.AddSegment方法的具体用法?C# Gradient.AddSegment怎么用?C# Gradient.AddSegment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gradient
的用法示例。
在下文中一共展示了Gradient.AddSegment方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
/// <summary>
/// Initilize various objects
/// </summary>
protected override void Initialize()
{
_keyboardManager = new KeyboardManager(this);
Components.Add(_keyboardManager);
_keyboardManager.AddListener(this);
_mouseManager = new MouseManager(this);
Components.Add(_mouseManager);
_mouseManager.AddListener(this);
//_camera = new CameraFirstPerson(this, 45, 0.01f, 100.0f);
_camera = new CameraTrackBall(this, 45, 0.01f, 100.0f);
_camera.Position = new Vector3(0, 0, 5);
Components.Add(_camera);
createVolumeRaycaster();
_gradEditor = new GradientEditor();
_gradient = new Gradient();
GradientSegment seg = new GradientSegment();
seg.Left = 0.0f;
seg.Middle = 0.5f;
seg.Right = 1.0f;
seg.LeftColor = new Vector4(1, 0, 0, 1.0f);
seg.RightColor = new Vector4(1, 0, 0, 1.0f);
seg.ColType = GradientSegment.ColorType.HSV_CCW;
_gradient.AddSegment(seg);
//seg.LookUpTable = palette.Colors;
//_gradient.AddSegment(seg);
//seg = new GradientSegment();
//seg.Left = 0;
//seg.Middle = 0.333f/2.0f;
//seg.Right = 0.333f;
//seg.LeftColor = ColorHelper.HsvToRgb(0, 1, 0, 1.0f);
//seg.RightColor = ColorHelper.HsvToRgb(0, 1, 0.8f, 1.0f);
//seg.ColType = GradientSegment.ColorType.HSV_CW;
//_gradient.AddSegment(seg);
//seg = new GradientSegment();
//seg.Left = 0.333f;
//seg.Middle = 0.333f+(1.0f-0.333f) / 2.0f;
//seg.Right = 1.0f;
//seg.LeftColor = ColorHelper.HsvToRgb(0, 1, 0.8f, 1.0f);
//seg.RightColor = ColorHelper.HsvToRgb(0.25f * 360.0f, 0, 1.0f, 1);
//seg.ColType = GradientSegment.ColorType.HSV_CW;
//_gradient.AddSegment(seg);
_gradEditor.Gradient = _gradient;
Color[] cols = _gradient.GetColors(256);
_vrc.TransferFunction = cols;
TransferFunction tf = new TransferFunction();
tf.Colors = cols;
tf.preIntegrate();
_vrc.TransferFunctionPreInt = tf;
_gradEditor.Show();
VolumeRaycasterSettings raySettings = new VolumeRaycasterSettings(_vrc);
raySettings.Show();
base.Initialize();
}