• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Matrix4类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



Matrix4类属于codechicken.lib.vec包,在下文中一共展示了Matrix4类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: renderTracker

import codechicken.lib.vec.Matrix4; //导入依赖的package包/类
public static void renderTracker(int freq)
{
    GlStateManager.disableLighting();

    TextureUtils.bindBlockTexture();
    CCRenderState ccrs = CCRenderState.instance();
    ccrs.reset();
    ccrs.startDrawing(7, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
    ccrs.colour = 0xFFFFFFFF;
    model.render(ccrs, new IconTransformation(TextureUtils.getBlockTexture("obsidian")));
    ccrs.draw();
    
    Matrix4 pearlMat = RenderUtils.getMatrix(
        new Vector3(0, 0.44+RedstoneEther.getSineWave(ClientUtils.getRenderTime(), 7)*0.02, 0),
        new Rotation(RedstoneEther.getRotation(ClientUtils.getRenderTime(), freq), new Vector3(0, 1, 0)),
        0.04);

    TextureUtils.changeTexture("wrcbe:textures/hedronmap.png");
    ccrs.startDrawing(4, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
    ccrs.colour = freq == 0 ? 0xC0C0C0FF : 0xFFFFFFFF;
    CCModelLibrary.icosahedron4.render(ccrs, pearlMat);
    ccrs.draw();

    GlStateManager.enableLighting();
}
 
开发者ID:TheCBProject,项目名称:WirelessRedstone,代码行数:26,代码来源:RenderTracker.java


示例2: doRenderLayer

import codechicken.lib.vec.Matrix4; //导入依赖的package包/类
@Override
public void doRenderLayer(AbstractClientPlayer entity, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
    if (uuid1.equals(entity.getUniqueID()) || uuid2.equals(entity.getUniqueID()) || uuid3.equals(entity.getUniqueID()) || uuid4.equals(entity.getUniqueID())) {
        GlStateManager.pushMatrix();
        Matrix4 matrix4 = new Matrix4();

        matrix4.apply(new Rotation(MathHelper.torad * 180, new Vector3(1, 0, 0)));
        matrix4.apply(new Scale(0.5));

        matrix4.glApply();
        if (entity.isSneaking()) {
            GlStateManager.translate(0, -0.5, 0);
        }
        if (entity.isElytraFlying()) {
            headPitch = -45;
        }
        GlStateManager.rotate(netHeadYaw, 0, -1, 0);
        GlStateManager.rotate(headPitch, 1, 0, 0);
        GlStateManager.translate(0, 1, 0);
        RenderTileEnderTank.renderTank(CCRenderState.instance(), 0, (float) (MathHelper.torad * 90F), new Frequency(), -0.5, 0, -0.5, 0);
        FluidStack fluidStack = FluidUtils.water.copy();
        float bob = 0.45F + RenderUtils.getPearlBob(ClientUtils.getRenderTime()) * 2;
        fluidStack.amount = (int) MathHelper.map(bob, 0.2, 0.6, 1000, 14000);
        RenderTileEnderTank.renderLiquid(fluidStack, -0.5, 0, -0.5);
        GlStateManager.popMatrix();
    }
}
 
开发者ID:TheCBProject,项目名称:EnderStorage,代码行数:28,代码来源:TankLayerRenderer.java


示例3: renderChest

import codechicken.lib.vec.Matrix4; //导入依赖的package包/类
public static void renderChest(int rotation, Frequency freq, double x, double y, double z, int offset, float lidAngle) {
    TileEntityRendererDispatcher info = TileEntityRendererDispatcher.instance;
    CCRenderState ccrs = CCRenderState.instance();
    ccrs.reset();

    renderEndPortal.render(x, y, z, 0, info.entityX, info.entityY, info.entityZ, info.renderEngine);
    GlStateManager.color(1, 1, 1, 1);

    TextureUtils.changeTexture("enderstorage:textures/enderchest.png");
    GlStateManager.pushMatrix();
    GlStateManager.enableRescaleNormal();
    GlStateManager.color(1, 1, 1, 1);
    GlStateManager.translate(x, y + 1.0, z + 1.0F);
    GlStateManager.scale(1.0F, -1F, -1F);
    GlStateManager.translate(0.5F, 0.5F, 0.5F);
    GlStateManager.rotate(rotation * 90, 0.0F, 1.0F, 0.0F);
    GlStateManager.translate(-0.5F, -0.5F, -0.5F);
    model.chestLid.rotateAngleX = lidAngle;
    model.render(freq.hasOwner());
    GlStateManager.popMatrix();

    GlStateManager.pushMatrix();
    GlStateManager.translate(x, y, z);
    renderButtons(freq, rotation, lidAngle);
    GlStateManager.popMatrix();

    double time = ClientUtils.getRenderTime() + offset;
    Matrix4 pearlMat = RenderUtils.getMatrix(new Vector3(x + 0.5, y + 0.2 + lidAngle * -0.5 + RenderUtils.getPearlBob(time), z + 0.5), new Rotation(time / 3, new Vector3(0, 1, 0)), 0.04);

    GlStateManager.disableLighting();
    TextureUtils.changeTexture("enderstorage:textures/hedronmap.png");
    GlStateManager.pushMatrix();

    ccrs.startDrawing(7, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
    CCModelLibrary.icosahedron7.render(ccrs, pearlMat);
    ccrs.draw();
    GlStateManager.popMatrix();
    GlStateManager.enableLighting();
}
 
开发者ID:TheCBProject,项目名称:EnderStorage,代码行数:40,代码来源:RenderTileEnderChest.java


示例4: renderItem

import codechicken.lib.vec.Matrix4; //导入依赖的package包/类
@Override
public void renderItem(ItemStack stack, TransformType transformType) {
    renderWrapped(stack);

    double rot = ClientUtils.getRenderTime() / 3F;
    double height;
    double size;
    double updown = (float) Math.sin(((ClientUtils.getRenderTime() % 50) / 25F) * 3.141593) * 0.2;

    if (stack.getMetadata() == 0) {
        height = 0.9;
        size = 0.08;
    } else {
        height = 0.5;
        size = 0.05;
    }

    CCRenderState ccrs = CCRenderState.instance();
    ccrs.reset();

    Matrix4 pearlMat = RenderUtils.getMatrix(new Vector3(0.5, height + (updown + 0.3), 0.5), new Rotation(rot, new Vector3(0, 1, 0)), size);

    disableLighting();
    pushMatrix();
    TextureUtils.changeTexture("chickenchunks:textures/hedronmap.png");
    ccrs.startDrawing(4, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
    CCModelLibrary.icosahedron4.render(ccrs, pearlMat);
    ccrs.draw();
    popMatrix();
    enableLighting();
}
 
开发者ID:TheCBProject,项目名称:ChickenChunks,代码行数:32,代码来源:ChunkLoaderItemModel.java


示例5: glUniformMatrix4

import codechicken.lib.vec.Matrix4; //导入依赖的package包/类
public void glUniformMatrix4(String location, boolean transpose, Matrix4 matrix) {
    glUniformMatrix(location, (loc) -> GL20.glUniformMatrix4(loc, transpose, matrix.toFloatBuffer()), transpose, matrix.toFloatBuffer());
}
 
开发者ID:TheCBProject,项目名称:CodeChickenLib,代码行数:4,代码来源:ShaderProgram.java


示例6: fromMatrix4

import codechicken.lib.vec.Matrix4; //导入依赖的package包/类
public static TRSRTransformation fromMatrix4(Matrix4 matrix4) {
    return new TRSRTransformation(matrix4.toMatrix4f());
}
 
开发者ID:TheCBProject,项目名称:CodeChickenLib,代码行数:4,代码来源:TransformUtils.java


示例7: render

import codechicken.lib.vec.Matrix4; //导入依赖的package包/类
@Override
public void render(TileChunkLoaderBase tile, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
    CCRenderState ccrs = CCRenderState.instance();
    ccrs.reset();
    ccrs.setBrightness(tile.getWorld(), tile.getPos());
    double rot = ClientUtils.getRenderTime() * 2;
    double height;
    double size;
    double updown = (ClientUtils.getRenderTime() % 50) / 25F;

    updown = (float) Math.sin(updown * 3.141593);
    updown *= 0.2;

    if (tile instanceof TileChunkLoader) {
        TileChunkLoader ctile = (TileChunkLoader) tile;
        rot /= Math.pow(ctile.radius, 0.2);
        height = 0.9;
        size = 0.08;
    } else if (tile instanceof TileSpotLoader) {
        height = 0.5;
        size = 0.05;
    } else {
        return;
    }

    RenderInfo renderInfo = tile.renderInfo;
    double active = (renderInfo.activationCounter) / 20D;
    if (tile.active && renderInfo.activationCounter < 20) {
        active += partialTicks / 20D;
    } else if (!tile.active && renderInfo.activationCounter > 0) {
        active -= partialTicks / 20D;
    }

    if (renderInfo.showLasers) {
        disableTexture2D();
        disableLighting();
        disableFog();
        drawRays(x, y, z, rot, updown, tile.getPos().getX(), tile.getPos().getY(), tile.getPos().getZ(), tile.getChunks());
        enableTexture2D();
        enableLighting();
        enableFog();
    }
    rot = ClientUtils.getRenderTime() * active / 3F;

    Matrix4 pearlMat = RenderUtils.getMatrix(new Vector3(x + 0.5, y + height + (updown + 0.3) * active, z + 0.5), new Rotation(rot, new Vector3(0, 1, 0)), size);
    disableLighting();
    pushMatrix();
    TextureUtils.changeTexture("chickenchunks:textures/hedronmap.png");
    ccrs.startDrawing(7, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
    CCModelLibrary.icosahedron7.render(ccrs, pearlMat);
    ccrs.draw();
    popMatrix();
    enableLighting();
}
 
开发者ID:TheCBProject,项目名称:ChickenChunks,代码行数:55,代码来源:TileChunkLoaderRenderer.java


示例8: renderAttachment

import codechicken.lib.vec.Matrix4; //导入依赖的package包/类
public static void renderAttachment(CCRenderState ccrs, int side, int type, double insertpos, int field, double x, double y, double z) {

        double tx = field / 64D;
        double ty = type / 2D;

        plates[side].render(ccrs, x + 0.5, y + 0.5, z + 0.5, tx, ty);

        Matrix4 matrix = new Matrix4().translate(new Vector3(x + 0.5, y + 0.5, z + 0.5)).apply(sideRotations[side]).translate(new Vector3(0, -0.5, 0)).scale(new Vector3(1, insertpos * 2 / 3 + 1 / 3D, 1));

        insert.render(ccrs, matrix, tx, ty);
    }
 
开发者ID:TheCBProject,项目名称:Translocators,代码行数:12,代码来源:TileTranslocatorRenderer.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java HttpClient类代码示例发布时间:2022-05-22
下一篇:
Java Enumerator类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap