當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。