本文整理汇总了Java中rajawali.primitives.Cube类的典型用法代码示例。如果您正苦于以下问题:Java Cube类的具体用法?Java Cube怎么用?Java Cube使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Cube类属于rajawali.primitives包,在下文中一共展示了Cube类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setSkybox
import rajawali.primitives.Cube; //导入依赖的package包/类
protected void setSkybox(int front, int right, int back, int left, int up, int down) {
mCamera.setFarPlane(1000);
mSkybox = new Cube(700, true);
Bitmap[] textures = new Bitmap[6];
textures[0] = BitmapFactory.decodeResource(mContext.getResources(), left);
textures[1] = BitmapFactory.decodeResource(mContext.getResources(), right);
textures[2] = BitmapFactory.decodeResource(mContext.getResources(), up);
textures[3] = BitmapFactory.decodeResource(mContext.getResources(), down);
textures[4] = BitmapFactory.decodeResource(mContext.getResources(), front);
textures[5] = BitmapFactory.decodeResource(mContext.getResources(), back);
mSkyboxTextureInfo = mTextureManager.addCubemapTextures(textures);
SkyboxMaterial mat = new SkyboxMaterial();
mat.addTexture(mSkyboxTextureInfo);
mSkybox.setMaterial(mat);
}
示例2: setSkybox
import rajawali.primitives.Cube; //导入依赖的package包/类
/**
* Creates a skybox with the specified single texture.
*
* @param resourceId int Resouce id of the skybox texture.
* @throws TextureException
*/
public void setSkybox(int resourceId) throws TextureException {
synchronized (mCameras) {
for (int i = 0, j = mCameras.size(); i < j; ++i)
mCameras.get(i).setFarPlane(1000);
}
synchronized (mNextSkyboxLock) {
mNextSkybox = new Cube(700, true, false);
mNextSkybox.setDoubleSided(true);
mSkyboxTexture = new Texture("skybox", resourceId);
Material material = new Material();
material.setColorInfluence(0);
material.addTexture(mSkyboxTexture);
mNextSkybox.setMaterial(material);
}
}
示例3: setSkybox
import rajawali.primitives.Cube; //导入依赖的package包/类
protected void setSkybox(int front, int right, int back, int left, int up, int down) {
mCamera.setFarPlane(1000);
mSkybox = new Cube(700, true);
Bitmap[] textures = new Bitmap[6];
textures[0] = BitmapFactory.decodeResource(mContext.getResources(), left);
textures[1] = BitmapFactory.decodeResource(mContext.getResources(), right);
textures[2] = BitmapFactory.decodeResource(mContext.getResources(), up);
textures[3] = BitmapFactory.decodeResource(mContext.getResources(), down);
textures[4] = BitmapFactory.decodeResource(mContext.getResources(), front);
textures[5] = BitmapFactory.decodeResource(mContext.getResources(), back);
mSkyboxTextureInfo = mTextureManager.addCubemapTextures(textures);
SkyboxMaterial mat = new SkyboxMaterial();
mat.addTexture(mSkyboxTextureInfo);
mSkybox.setMaterial(mat);
}