本文整理汇总了C#中Vector3D.CopyTo方法的典型用法代码示例。如果您正苦于以下问题:C# Vector3D.CopyTo方法的具体用法?C# Vector3D.CopyTo怎么用?C# Vector3D.CopyTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vector3D
的用法示例。
在下文中一共展示了Vector3D.CopyTo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CPURelativeToEye
public CPURelativeToEye(Context context, Vector3D[] positions, byte[] colors)
{
_sp = Device.CreateShaderProgram(
EmbeddedResources.GetText("OpenGlobe.Examples.CPURelativeToEye.Shaders.VS.glsl"),
EmbeddedResources.GetText("OpenGlobe.Examples.Shaders.FS.glsl"));
_modelViewPerspectiveMatrixRelativeToEye = (Uniform<Matrix4F>)(_sp.Uniforms["u_modelViewPerspectiveMatrixRelativeToEye"]);
_pointSize = (Uniform<float>)_sp.Uniforms["u_pointSize"];
///////////////////////////////////////////////////////////////////
_positions = new Vector3D[positions.Length];
positions.CopyTo(_positions, 0);
_positionsRelativeToEye = new Vector3F[_positions.Length];
_eye = Vector3D.Zero;
//
// _positionBuffer is dynamic, and is written to when the camera moves.
//
_positionBuffer = Device.CreateVertexBuffer(BufferHint.DynamicDraw, ArraySizeInBytes.Size(_positionsRelativeToEye));
_colorBuffer = Device.CreateVertexBuffer(BufferHint.StaticDraw, colors.Length);
_colorBuffer.CopyFromSystemMemory(colors);
_va = context.CreateVertexArray();
_va.Attributes[_sp.VertexAttributes["position"].Location] =
new VertexBufferAttribute(_positionBuffer, ComponentDatatype.Float, 3);
_va.Attributes[_sp.VertexAttributes["color"].Location] =
new VertexBufferAttribute(_colorBuffer, ComponentDatatype.UnsignedByte, 3, true, 0, 0);
///////////////////////////////////////////////////////////////////
RenderState renderState = new RenderState();
renderState.FacetCulling.Enabled = false;
renderState.DepthTest.Enabled = false;
renderState.ProgramPointSize = ProgramPointSize.Enabled;
_drawState = new DrawState(renderState, _sp, _va);
}