/**
* Draw this primitve. This is typically called only once as the generated drawing instructions are saved by the
* renderer and reused later.
*/
public void draw(WorldRenderer renderer, float scale)
{
Vec3 vec3 = this.vertexPositions[1].vector3D.subtractReverse(this.vertexPositions[0].vector3D);
Vec3 vec31 = this.vertexPositions[1].vector3D.subtractReverse(this.vertexPositions[2].vector3D);
Vec3 vec32 = vec31.crossProduct(vec3).normalize();
float f = (float)vec32.xCoord;
float f1 = (float)vec32.yCoord;
float f2 = (float)vec32.zCoord;
if (this.invertNormal)
{
f = -f;
f1 = -f1;
f2 = -f2;
}
renderer.begin(7, DefaultVertexFormats.OLDMODEL_POSITION_TEX_NORMAL);
for (int i = 0; i < 4; ++i)
{
PositionTextureVertex positiontexturevertex = this.vertexPositions[i];
renderer.pos(positiontexturevertex.vector3D.xCoord * (double)scale, positiontexturevertex.vector3D.yCoord * (double)scale, positiontexturevertex.vector3D.zCoord * (double)scale).tex((double)positiontexturevertex.texturePositionX, (double)positiontexturevertex.texturePositionY).normal(f, f1, f2).endVertex();
}
Tessellator.getInstance().draw();
}
TexturedQuad.java 文件源码
java
阅读 26
收藏 0
点赞 0
评论 0
项目:BaseClient
作者:
评论列表
文章目录