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


Java CCModel类代码示例

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


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

示例1: compileModel

import codechicken.lib.render.CCModel; //导入依赖的package包/类
private CCModel compileModel(float scale) {
    if (compiled) {
        return compiledModel;
    }

    CCModel model = CCModel.newModel(GL11.GL_QUADS);
    LinkedList<Vertex5> vertices = new LinkedList<>();
    for (CCModelBox box : cubeList) {
        for (CCQuad quad : box.getQuads()) {
            Collections.addAll(vertices, quad.vertices);
        }
    }
    model.verts = vertices.toArray(new Vertex5[vertices.size()]);
    model.computeNormals();

    compiledModel = model.copy().apply(new Scale(scale));

    this.compiled = true;
    return compiledModel;
}
 
开发者ID:TheCBProject,项目名称:CodeChickenLib,代码行数:21,代码来源:CCModelRenderer.java

示例2: renderModels

import codechicken.lib.render.CCModel; //导入依赖的package包/类
public static void renderModels(float scale, BufferBuilder buffer, TextureAtlasSprite sprite, CCModelRenderer... modelRenders) {
    LinkedList<CCModel> models = new LinkedList<>();
    for (CCModelRenderer modelRenderer : modelRenders) {
        models.add(modelRenderer.bake(scale));
    }
    CCModel model = CCModel.combine(models);

    //TODO
    //CCRenderState.bind(buffer);
    //boolean startDrawing = !CCRenderState.isDrawing();
    //if (startDrawing) {
    //    CCRenderState.startDrawing(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_NORMAL);
    //}
    //model.render();
    //if (startDrawing) {
    //    CCRenderState.draw();
    //}
}
 
开发者ID:TheCBProject,项目名称:CodeChickenLib,代码行数:19,代码来源:CCModelBase.java

示例3: init

import codechicken.lib.render.CCModel; //导入依赖的package包/类
public static void init()
{
	INSTANCE = new RenderGlowPanel();
	TextureUtils.addIconRegistrar(INSTANCE);

	Map<String, CCModel> models = CCModel.parseObjModels(MekanismUtils.getResource(ResourceType.MODEL, "glow_panel.obj"), 7, null);

	frameModels = new CCModel[6];
	frameModels[0] = models.get("frame").backfacedCopy().apply(Vector3.center.translation()).shrinkUVs(0.0005);
	CCModel.generateSidedModels(frameModels, 0, Vector3.center);

	lightModels = new CCModel[6];
	lightModels[0] = models.get("light").backfacedCopy().apply(Vector3.center.translation()).shrinkUVs(0.0005);
	CCModel.generateSidedModels(lightModels, 0, Vector3.center);

	for(CCModel c : frameModels)
	{
		c.computeLighting(LightModel.standardLightModel);
	}
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:21,代码来源:RenderGlowPanel.java

示例4: renderPart

import codechicken.lib.render.CCModel; //导入依赖的package包/类
public void renderPart(IIcon icon, CCModel cc, double x, double y, double z, Colour color)
{
	if(color != null)
	{
		cc.render(new Translation(x, y, z), new IconTransformation(icon), new ColourMultiplier(color.rgba()));
	}
	else {
		cc.render(new Translation(x, y, z), new IconTransformation(icon));
	}
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:11,代码来源:RenderPartTransmitter.java

示例5: renderTransparency

import codechicken.lib.render.CCModel; //导入依赖的package包/类
public void renderTransparency(IIcon icon, CCModel cc, Colour color)
{
	if(color != null)
	{
		cc.render(new IconTransformation(icon), new ColourMultiplier(color.rgba()));
	}
	else {
		cc.render(new IconTransformation(icon));
	}
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:11,代码来源:RenderPartTransmitter.java

示例6: getItemModel

import codechicken.lib.render.CCModel; //导入依赖的package包/类
public CCModel getItemModel(ForgeDirection side, TransmitterType type)
{
	String name = side.name().toLowerCase();
	boolean out = side == ForgeDirection.UP || side == ForgeDirection.DOWN;
	name += out ? "NORMAL" : "NONE";
	
	if(type.getSize() == Size.SMALL)
	{
		return small_models.get(name);
	}
	else {
		return large_models.get(name);
	}
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:15,代码来源:RenderPartTransmitter.java

示例7: MultiPartCarpetTest

import codechicken.lib.render.CCModel; //导入依赖的package包/类
public MultiPartCarpetTest(int newMeta) {
    renderer = new RenderBlocksCTMCarpet();
    meta = (byte) newMeta;
    carpetModel = CCModel.quadModel(24);
    bounds = new Cuboid6(base.getBlockBoundsMinX(), base.getBlockBoundsMinY(), base.getBlockBoundsMinZ(),
            base.getBlockBoundsMaxX(), base.getBlockBoundsMaxY(), base.getBlockBoundsMaxZ());
    carpetModel.generateBlock(0, bounds);

}
 
开发者ID:delta534,项目名称:Chisel,代码行数:10,代码来源:MultiPartCarpetTest.java

示例8: BlockAdvancedMarbleRenderer

import codechicken.lib.render.CCModel; //导入依赖的package包/类
public BlockAdvancedMarbleRenderer() {
    if (Chisel.RenderCTMId == 0) {
        Chisel.RenderCTMId = RenderingRegistry.getNextAvailableRenderId();
    }
    model = CCModel.quadModel(24);

}
 
开发者ID:delta534,项目名称:Chisel,代码行数:8,代码来源:BlockAdvancedMarbleRenderer.java

示例9: compute

import codechicken.lib.render.CCModel; //导入依赖的package包/类
public LC compute(Vector3 vec, Vector3 normal)
{
    int side = CCModel.findSide(normal);
    if (side < 0)
    {
        return set(12, 1, 0, 0, 0);
    }
    return compute(vec, side);
}
 
开发者ID:Darkona,项目名称:AdventureBackpack2,代码行数:10,代码来源:LC.java

示例10: compute

import codechicken.lib.render.CCModel; //导入依赖的package包/类
public LC compute(Vector3 vec, Vector3 normal) {
    int side = CCModel.findSide(normal);
    if (side < 0)
        return set(12, 1, 0, 0, 0);
    return compute(vec, side);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:7,代码来源:LC.java

示例11: generateButton

import codechicken.lib.render.CCModel; //导入依赖的package包/类
private static void generateButton() {
    button = CCModel.quadModel(20);
    Vector3 min = TileFrequencyOwner.selection_button.min;
    Vector3 max = TileFrequencyOwner.selection_button.max;
    Vector3[] corners = new Vector3[8];
    corners[0] = new Vector3(min.x, min.y, min.z);
    corners[1] = new Vector3(max.x, min.y, min.z);
    corners[3] = new Vector3(min.x, max.y, min.z);
    corners[2] = new Vector3(max.x, max.y, min.z);
    corners[4] = new Vector3(min.x, min.y, max.z);
    corners[5] = new Vector3(max.x, min.y, max.z);
    corners[7] = new Vector3(min.x, max.y, max.z);
    corners[6] = new Vector3(max.x, max.y, max.z);

    int i = 0;
    Vertex5[] verts = button.verts;

    verts[i++] = new Vertex5(corners[7], 0.0938, 0.0625);
    verts[i++] = new Vertex5(corners[6], 0.1562, 0.0625);
    verts[i++] = new Vertex5(corners[2], 0.1562, 0.1875);
    verts[i++] = new Vertex5(corners[3], 0.0938, 0.1875);

    verts[i++] = new Vertex5(corners[4], 0.0938, 0.0313);
    verts[i++] = new Vertex5(corners[5], 0.1562, 0.0624);
    verts[i++] = new Vertex5(corners[6], 0.1562, 0.0624);
    verts[i++] = new Vertex5(corners[7], 0.0938, 0.0313);

    verts[i++] = new Vertex5(corners[0], 0.0938, 0.2186);
    verts[i++] = new Vertex5(corners[3], 0.0938, 0.1876);
    verts[i++] = new Vertex5(corners[2], 0.1562, 0.1876);
    verts[i++] = new Vertex5(corners[1], 0.1562, 0.2186);

    verts[i++] = new Vertex5(corners[6], 0.1563, 0.0626);
    verts[i++] = new Vertex5(corners[5], 0.1874, 0.0626);
    verts[i++] = new Vertex5(corners[1], 0.1874, 0.1874);
    verts[i++] = new Vertex5(corners[2], 0.1563, 0.1874);

    verts[i++] = new Vertex5(corners[7], 0.0937, 0.0626);
    verts[i++] = new Vertex5(corners[3], 0.0937, 0.1874);
    verts[i++] = new Vertex5(corners[0], 0.0626, 0.1874);
    verts[i++] = new Vertex5(corners[4], 0.0626, 0.0626);

    button.computeNormals();
}
 
开发者ID:TheCBProject,项目名称:EnderStorage,代码行数:45,代码来源:ButtonModelLibrary.java


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