本文整理汇总了C#中System.Vector4.ToList方法的典型用法代码示例。如果您正苦于以下问题:C# Vector4.ToList方法的具体用法?C# Vector4.ToList怎么用?C# Vector4.ToList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Vector4
的用法示例。
在下文中一共展示了Vector4.ToList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateLineVBO
void GenerateLineVBO()
{
Vector3[] vecs = new Vector3[2];
uint[] inds = new uint[2];
Vector3[] norms = new Vector3[2];
Vector3[] texs = new Vector3[2];
Vector4[] cols = new Vector4[2];
for (uint u = 0; u < 2; u++)
{
inds[u] = u;
}
for (int n = 0; n < 2; n++)
{
norms[n] = new Vector3(0, 0, 1);
}
for (int c = 0; c < 2; c++)
{
cols[c] = new Vector4(1, 1, 1, 1);
}
Vector4[] BoneIDs = new Vector4[2];
Vector4[] BoneWeights = new Vector4[2];
Vector4[] BoneIDs2 = new Vector4[2];
Vector4[] BoneWeights2 = new Vector4[2];
for (int n = 0; n < 2; n++)
{
BoneIDs[n] = new Vector4(0, 0, 0, 0);
BoneWeights[n] = new Vector4(0, 0, 0, 0);
BoneIDs2[n] = new Vector4(0, 0, 0, 0);
BoneWeights2[n] = new Vector4(0, 0, 0, 0);
}
vecs[0] = new Vector3(0, 0, 0);
texs[0] = new Vector3(0, 0, 0);
vecs[1] = new Vector3(1, 0, 0);
texs[1] = new Vector3(1, 0, 0);
Line = new VBO();
Line.Vertices = vecs.ToList();
Line.Indices = inds.ToList();
Line.Normals = norms.ToList();
Line.TexCoords = texs.ToList();
Line.Colors = cols.ToList();
Line.BoneIDs = BoneIDs.ToList();
Line.BoneWeights = BoneWeights.ToList();
Line.BoneIDs2 = BoneIDs2.ToList();
Line.BoneWeights2 = BoneWeights2.ToList();
Line.GenerateVBO();
}
示例2: GenerateSquareVBO
void GenerateSquareVBO()
{
Vector3[] vecs = new Vector3[6];
uint[] inds = new uint[6];
Vector3[] norms = new Vector3[6];
Vector3[] texs = new Vector3[6];
Vector4[] cols = new Vector4[6];
Vector4[] BoneIDs = new Vector4[6];
Vector4[] BoneWeights = new Vector4[6];
Vector4[] BoneIDs2 = new Vector4[6];
Vector4[] BoneWeights2 = new Vector4[6];
for (uint n = 0; n < 6; n++)
{
inds[n] = n;
norms[n] = new Vector3(0, 0, 1);
cols[n] = new Vector4(1, 1, 1, 1);
BoneIDs[n] = new Vector4(0, 0, 0, 0);
BoneWeights[n] = new Vector4(0, 0, 0, 0);
BoneIDs2[n] = new Vector4(0, 0, 0, 0);
BoneWeights2[n] = new Vector4(0, 0, 0, 0);
}
vecs[0] = new Vector3(1, 0, 0);
texs[0] = new Vector3(1, 0, 0);
vecs[1] = new Vector3(1, 1, 0);
texs[1] = new Vector3(1, 1, 0);
vecs[2] = new Vector3(0, 1, 0);
texs[2] = new Vector3(0, 1, 0);
vecs[3] = new Vector3(1, 0, 0);
texs[3] = new Vector3(1, 0, 0);
vecs[4] = new Vector3(0, 1, 0);
texs[4] = new Vector3(0, 1, 0);
vecs[5] = new Vector3(0, 0, 0);
texs[5] = new Vector3(0, 0, 0);
Square = new VBO();
Square.Vertices = vecs.ToList();
Square.Indices = inds.ToList();
Square.Normals = norms.ToList();
Square.TexCoords = texs.ToList();
Square.Colors = cols.ToList();
Square.BoneIDs = BoneIDs.ToList();
Square.BoneWeights = BoneWeights.ToList();
Square.BoneIDs2 = BoneIDs2.ToList();
Square.BoneWeights2 = BoneWeights2.ToList();
Square.GenerateVBO();
}
示例3: GenerateBoxVBO
void GenerateBoxVBO()
{
// TODO: Optimize?
Vector3[] vecs = new Vector3[24];
uint[] inds = new uint[24];
Vector3[] norms = new Vector3[24];
Vector3[] texs = new Vector3[24];
Vector4[] cols = new Vector4[24];
for (uint u = 0; u < 24; u++)
{
inds[u] = u;
}
for (int t = 0; t < 24; t++)
{
texs[t] = new Vector3(0, 0, 0);
}
for (int n = 0; n < 24; n++)
{
norms[n] = new Vector3(0, 0, 1); // TODO: Accurate normals somehow? Do lines even have normals?
}
for (int c = 0; c < 24; c++)
{
cols[c] = new Vector4(1, 1, 1, 1);
}
Vector4[] BoneIDs = new Vector4[24];
Vector4[] BoneWeights = new Vector4[24];
Vector4[] BoneIDs2 = new Vector4[24];
Vector4[] BoneWeights2 = new Vector4[24];
for (int n = 0; n < 24; n++)
{
BoneIDs[n] = new Vector4(0, 0, 0, 0);
BoneWeights[n] = new Vector4(0, 0, 0, 0);
BoneIDs2[n] = new Vector4(0, 0, 0, 0);
BoneWeights2[n] = new Vector4(0, 0, 0, 0);
}
int i = 0;
int zero = -1; // Ssh.
vecs[i] = new Vector3(zero, zero, zero); i++;
vecs[i] = new Vector3(1, zero, zero); i++;
vecs[i] = new Vector3(1, zero, zero); i++;
vecs[i] = new Vector3(1, 1, zero); i++;
vecs[i] = new Vector3(1, 1, zero); i++;
vecs[i] = new Vector3(zero, 1, zero); i++;
vecs[i] = new Vector3(zero, 1, zero); i++;
vecs[i] = new Vector3(zero, zero, zero); i++;
vecs[i] = new Vector3(zero, zero, 1); i++;
vecs[i] = new Vector3(1, zero, 1); i++;
vecs[i] = new Vector3(1, zero, 1); i++;
vecs[i] = new Vector3(1, 1, 1); i++;
vecs[i] = new Vector3(1, 1, 1); i++;
vecs[i] = new Vector3(zero, 1, 1); i++;
vecs[i] = new Vector3(zero, 1, 1); i++;
vecs[i] = new Vector3(zero, zero, 1); i++;
vecs[i] = new Vector3(zero, zero, zero); i++;
vecs[i] = new Vector3(zero, zero, 1); i++;
vecs[i] = new Vector3(1, zero, zero); i++;
vecs[i] = new Vector3(1, zero, 1); i++;
vecs[i] = new Vector3(1, 1, zero); i++;
vecs[i] = new Vector3(1, 1, 1); i++;
vecs[i] = new Vector3(zero, 1, zero); i++;
vecs[i] = new Vector3(zero, 1, 1); i++;
Box = new VBO();
Box.Vertices = vecs.ToList();
Box.Indices = inds.ToList();
Box.Normals = norms.ToList();
Box.TexCoords = texs.ToList();
Box.Colors = cols.ToList();
Box.BoneIDs = BoneIDs.ToList();
Box.BoneWeights = BoneWeights.ToList();
Box.BoneIDs2 = BoneIDs2.ToList();
Box.BoneWeights2 = BoneWeights2.ToList();
Box.GenerateVBO();
}