当前位置: 首页>>代码示例>>C#>>正文


C# OpenTK.Vector3类代码示例

本文整理汇总了C#中OpenTK.Vector3的典型用法代码示例。如果您正苦于以下问题:C# Vector3类的具体用法?C# Vector3怎么用?C# Vector3使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Vector3类属于OpenTK命名空间,在下文中一共展示了Vector3类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Builder

			internal Builder()
			{
				_position = Vector3.Zero;
				_color = 0;
				_textureUV = Vector2.Zero;
				_normal = Vector3.Zero;
			}
开发者ID:treytomes,项目名称:ASCIIWorld2,代码行数:7,代码来源:VertexBufferElement.cs

示例2: OutputParticle

 /// <summary>
 /// 粒子を作成する
 /// </summary>
 /// <param name="_x">中心座標</param>
 /// <param name="_d">直径</param>
 /// <param name="_color">表示色</param>
 public OutputParticle(Vector3 _x, float _d, Color4 _color)
 {
     // 各パラメーターを設定
     this.X = _x;
     this.d = _d;
     this.color = _color;
 }
开发者ID:aokomoriuta,项目名称:StudiesOfOpenTK,代码行数:13,代码来源:OutputParticle.cs

示例3: CreateCubeMesh

        public IEnumerable<Face> CreateCubeMesh()
        {
            //Front
            var vertex0 = new Vector3(-0.5f, -0.5f, 0.5f);
            var vertex1 = new Vector3(-0.5f, 0.5f, 0.5f);
            var vertex2 = new Vector3(0.5f, 0.5f, 0.5f);
            var vertex3 = new Vector3(0.5f, -0.5f, 0.5f);

            //Rear
            var vertex4 = new Vector3(-0.5f, -0.5f, -0.5f);
            var vertex5 = new Vector3(-0.5f, 0.5f, -0.5f);
            var vertex6 = new Vector3(0.5f, 0.5f, -0.5f);
            var vertex7 = new Vector3(0.5f, -0.5f, -0.5f);

            var front = new Face(new List<Vector3> { vertex0, vertex1, vertex2, vertex3 });
            var back = new Face(new List<Vector3> { vertex4, vertex5, vertex6, vertex7 });

            var left = new Face(new List<Vector3> { vertex4, vertex5, vertex1, vertex0 });
            var right = new Face(new List<Vector3> { vertex7, vertex3, vertex2, vertex6 });

            var top = new Face(new List<Vector3> { vertex1, vertex5, vertex6, vertex2 });
            var bottom = new Face(new List<Vector3> { vertex0, vertex4, vertex7, vertex3 });

            return new List<Face> {front, back, left, right, top, bottom};
        }
开发者ID:ChrisJansson,项目名称:ObjLoader,代码行数:25,代码来源:Catmull.cs

示例4: Body

 public Body(Vector3 location, float mass)
 {
     Acceleration = Vector3.Zero;
     Location = location;
     Mass = mass;
     Velocity = Vector3.Zero;
 }
开发者ID:danielscherzer,项目名称:Framework,代码行数:7,代码来源:Body.cs

示例5: GetOrientationMatrix

 /// <summary>
 /// Returns a rotation matrix with position <0,0,0> according to vector x and z
 /// </summary>
 /// <param name="x"> the x vector</param>
 /// <param name="z">the z vector</param>
 /// <returns>Rotation matrix</returns>
 public static Matrix4 GetOrientationMatrix(Vector3 x, Vector3 z)
 {
     x.NormalizeFast();
     z.NormalizeFast();
     Vector3 y = Vector3.Cross(z, x);
     return GetMatrix(Vector3.Zero, z, y, Vector3.Cross(y, z));
 }
开发者ID:jamesrrowland,项目名称:Qualisys-Unity-SDK,代码行数:13,代码来源:Matrix4Helper.cs

示例6: Ray

 public Ray(Vector3 position, Vector3 direction, float minT, float maxT)
 {
     Origin = position;
     Direction = direction;
     this.tMin = minT;
     this.tMax = maxT;
 }
开发者ID:kwaegel,项目名称:muTracer,代码行数:7,代码来源:Ray.cs

示例7: BuildingVertex

#pragma warning restore 414

        public BuildingVertex(Vector3 position, Vector3 normal, Vector2 uv, float alpha = 1)
        {
            this.position = position;
            this.normal = normal;
            this.uv = uv;
            this.alpha = alpha;
        }
开发者ID:amulware,项目名称:ld33,代码行数:9,代码来源:BuildingVertex.cs

示例8: TransformationManager

 public TransformationManager(Vector3 pos, Quaternion orient)
 {
     Position = pos;
     Orientation = orient;
     ScaleValue = new Vector3(1, 1, 1);
     BeenModified = true;
 }
开发者ID:yanko,项目名称:vengine,代码行数:7,代码来源:TransformationManager.cs

示例9: CreateCube

    private void CreateCube(float x, float y, float z, float sizeX, float sizeY, float sizeZ)
    {
      //Top vertexes
      var point1Bottom = new Vector3(x, z, y);
      var point2Bottom = new Vector3(x + sizeX, z, y);
      var point3Bottom = new Vector3(x + sizeX, z, y + sizeY);
      var point4Bottom = new Vector3(x, z, y + sizeY);

      //Bottom vertexes
      var point1Top = new Vector3(x, z + sizeZ, y);
      var point2Top = new Vector3(x + sizeX, z + sizeZ, y);
      var point3Top = new Vector3(x + sizeX, z + sizeZ, y + sizeY);
      var point4Top = new Vector3(x, z + sizeZ, y + sizeY);

      //Normals
      var topNormal = new Vector3(0, 1, 0);
      var bottomNormal = new Vector3(0, -1, 0);
      var leftNormal = new Vector3(-1, 0, 0);
      var rightNormal = new Vector3(1, 0, 0);
      var farNormal = new Vector3(0, 0, -1);
      var nearNormal = new Vector3(0, 0, 1);

      CreateCubeFace(point4Top, point1Top, point2Top, point3Top, topNormal);
      CreateCubeFace(point1Bottom, point4Bottom, point3Bottom, point2Bottom, bottomNormal);
      CreateCubeFace(point1Top, point1Bottom, point2Bottom, point2Top, farNormal);
      CreateCubeFace(point3Top, point3Bottom, point4Bottom, point4Top, nearNormal);
      CreateCubeFace(point4Top, point4Bottom, point1Bottom, point1Top, leftNormal);
      CreateCubeFace(point2Top, point2Bottom, point3Bottom, point3Top, rightNormal);
    }
开发者ID:dgopena,项目名称:Starter3D.Base,代码行数:29,代码来源:Cube.cs

示例10: ProcessVertex

        public void ProcessVertex(string line, Mesh mesh)
        {
            if (!mesh.SubMeshes.Any())
                mesh.SubMeshes.Add(new SubMesh());

            var tokens = line.Split(' ');
            if (tokens.Length != 4) return;

            Vector3 vertex = new Vector3
            {
                X = float.Parse(tokens[1], Style, Info),
                Y = float.Parse(tokens[2], Style, Info),
                Z = float.Parse(tokens[3], Style, Info)
            };

            mesh.SubMeshes.Last().Vertices.Add(vertex);

            //	Bounds
            if (vertex.X < mesh.MinVertex.X) mesh.MinVertex.X = vertex.X;
            if (vertex.Y < mesh.MinVertex.Y) mesh.MinVertex.Y = vertex.Y;
            if (vertex.Z < mesh.MinVertex.Z) mesh.MinVertex.Z = vertex.Z;

            if (vertex.X > mesh.MaxVertex.X) mesh.MaxVertex.X = vertex.X;
            if (vertex.Y > mesh.MaxVertex.Y) mesh.MaxVertex.Y = vertex.Y;
            if (vertex.Z > mesh.MaxVertex.Z) mesh.MaxVertex.Z = vertex.Z;
        }
开发者ID:org-itbiz,项目名称:ObjParserNet,代码行数:26,代码来源:ParsingWorker.cs

示例11: Material

 //The material constructor, takes a color Vector, a diffuse value, reflection value and a recursionDepth.
 public Material(Vector3 color, float diffuse, float reflection, float recursionDepth)
 {
     this.color = color;
     this.diffuse = diffuse;
     this.reflection = reflection;
     this.recursionDepth = recursionDepth;
 }
开发者ID:Fortunos,项目名称:CVAlexLeestemaker,代码行数:8,代码来源:Material.cs

示例12: Spotlight

 //Spotlight constructor, takes a position Vector, a color Vector, a direction Vector and 
 public Spotlight(Vector3 position, Vector3 color, Vector3 direction, float minDot)
 {
     pos = position;
     this.color = color;
     D = direction.Normalized();
     this.minDot = minDot;
 }
开发者ID:Fortunos,项目名称:CVAlexLeestemaker,代码行数:8,代码来源:Light.cs

示例13: SimpleSpriteVertexData

 /// <summary>
 /// Initializes a new instance of the <see cref="SimpleSpriteVertexData"/> struct.
 /// </summary>
 /// <param name="position">The position.</param>
 /// <param name="uv">The uv coordinates.</param>
 /// <param name="color">The color.</param>
 /// <param name="expand">The vector by which to move the vertex in camera space, parallel to the view plane.</param>
 public SimpleSpriteVertexData(Vector3 position, Vector2 uv, Color color, Vector2 expand)
 {
     this.Position = position;
     this.TexCoord = uv;
     this.Color = color;
     this.Expand = expand;
 }
开发者ID:corefan,项目名称:awgraphics,代码行数:14,代码来源:SimpleSpriteVertexData.cs

示例14: CheckSphere

		public bool CheckSphere(Vector3 boundingSphereCenter, float boundingSphereR)
		{
			if (!this.Front.CheckSphere(ref boundingSphereCenter, ref boundingSphereR))
			{
				return false;
			}
			if (!this.Back.CheckSphere(ref boundingSphereCenter, ref boundingSphereR))
			{
				return false;
			}
			if (!this.Right.CheckSphere(ref boundingSphereCenter, ref boundingSphereR))
			{
				return false;
			}
			if (!this.Right2.CheckSphere(ref boundingSphereCenter, ref boundingSphereR))
			{
				return false;
			}
			if (!this.Right3.CheckSphere(ref boundingSphereCenter, ref boundingSphereR))
			{
				return false;
			}
			if (!this.Right4.CheckSphere(ref boundingSphereCenter, ref boundingSphereR))
			{
				return false;
			}
			return true;
		}
开发者ID:gleblebedev,项目名称:toe,代码行数:28,代码来源:Frustum.cs

示例15: Vertex2D

 /// <summary>
 /// Initializes a new instance of the <see cref="nginz.Vertex2D"/> struct.
 /// </summary>
 /// <param name="pos">Position.</param>
 /// <param name="texcoord">Texcoord.</param>
 /// <param name="color">Color.</param>
 public Vertex2D(Vector3 pos, Vector2 texcoord, Color4 color)
     : this()
 {
     Position = pos;
     TextureCoordinate = texcoord;
     Color = color;
 }
开发者ID:splitandthechro,项目名称:nginz,代码行数:13,代码来源:Vertex2D.cs


注:本文中的OpenTK.Vector3类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。