本文整理汇总了Java中org.rajawali3d.materials.textures.CubeMapTexture类的典型用法代码示例。如果您正苦于以下问题:Java CubeMapTexture类的具体用法?Java CubeMapTexture怎么用?Java CubeMapTexture使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CubeMapTexture类属于org.rajawali3d.materials.textures包,在下文中一共展示了CubeMapTexture类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setSkybox
import org.rajawali3d.materials.textures.CubeMapTexture; //导入依赖的package包/类
/**
* Creates a skybox with the specified 6 textures.
*
* @param posx int Resource id for the front face.
* @param negx int Resource id for the right face.
* @param posy int Resource id for the back face.
* @param negy int Resource id for the left face.
* @param posz int Resource id for the up face.
* @param negz int Resource id for the down face.
* @throws TextureException
*/
public void setSkybox(int posx, int negx, int posy, int negy, int posz, int negz) 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);
int[] resourceIds = new int[] { posx, negx, posy, negy, posz, negz };
mSkyboxTexture = new CubeMapTexture("skybox", resourceIds);
((CubeMapTexture)mSkyboxTexture).isSkyTexture(true);
Material mat = new Material();
mat.setColorInfluence(0);
mat.addTexture(mSkyboxTexture);
mNextSkybox.setMaterial(mat);
}
}
示例2: setSkybox
import org.rajawali3d.materials.textures.CubeMapTexture; //导入依赖的package包/类
/**
* Creates a skybox with the specified 6 textures.
*
* @param posx int Resource id for the front face.
* @param negx int Resource id for the right face.
* @param posy int Resource id for the back face.
* @param negy int Resource id for the left face.
* @param posz int Resource id for the up face.
* @param negz int Resource id for the down face.
* @throws TextureException
*/
public void setSkybox(int posx, int negx, int posy, int negy, int posz, int negz) 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);
int[] resourceIds = new int[] { posx, negx, posy, negy, posz, negz };
mSkyboxTexture = new CubeMapTexture("skybox", resourceIds);
((CubeMapTexture)mSkyboxTexture).isSkyTexture(true);
Material mat = new Material();
mat.setColorInfluence(0);
mat.addTexture(mSkyboxTexture);
mNextSkybox.setMaterial(mat);
}
}
示例3: initScene
import org.rajawali3d.materials.textures.CubeMapTexture; //导入依赖的package包/类
@Override
protected void initScene() {
try {
mLight = new DirectionalLight(0.1f, -1.0f, -1.0f);
mLight.setColor(1.0f, 1.0f, 1.0f);
mLight.setPower(1);
getCurrentScene().addLight(mLight);
final LoaderAWD parser = new LoaderAWD(mContext.getResources(), mTextureManager, R.raw.head_object_new);
parser.parse();
mMonkey = parser.getParsedObject();
mMonkey.setScale(0.005f);
//mMonkey.setZ(-2f);
// getCurrentScene().addChild(mMonkey);
int[] resourceIds = new int[]{R.drawable.posx, R.drawable.negx,
R.drawable.posy, R.drawable.negy, R.drawable.posz,
R.drawable.negz};
Material material = new Material();
material.enableLighting(true);
material.setDiffuseMethod(new DiffuseMethod.Lambert());
CubeMapTexture envMap = new CubeMapTexture("environmentMap",
resourceIds);
envMap.isEnvironmentTexture(true);
material.addTexture(envMap);
material.setColorInfluence(0);
mMonkey.setMaterial(material);
LoaderOBJ objParser1 = new LoaderOBJ(mContext.getResources(), mTextureManager, R.raw.glasses_obj);
objParser1.parse();
mGlasses = objParser1.getParsedObject();
mGlasses.setScale(0.005f);
//mGlasses.setZ(-0.2f);
mGlasses.setZ(0.3f);
mGlasses.rotate(Vector3.Axis.X, -90.0f);
LoaderOBJ objParser2 = new LoaderOBJ(mContext.getResources(), mTextureManager, R.raw.hair_band_obj);
objParser2.parse();
mHairBand = objParser2.getParsedObject();
mHairBand.setScale(0.006f);
mHairBand.setY(0.27f);
mHairBand.setZ(-0.25f);
mHairBand.rotate(Vector3.Axis.X, -90.0f);
LoaderOBJ objParser3 = new LoaderOBJ(mContext.getResources(), mTextureManager, R.raw.moustache_obj);
objParser3.parse();
mMoustache = objParser3.getParsedObject();
mMoustache.setScale(0.007f);
mMoustache.setY(-0.25f);
mMoustache.setZ(0.3f);
mMoustache.rotate(Vector3.Axis.X, -90.0f);
mContainer = new Object3D();
mContainer.addChild(mMonkey);
mContainer.addChild(mGlasses);
mContainer.addChild(mHairBand);
mContainer.addChild(mMoustache);
getCurrentScene().addChild(mContainer);
//getCurrentCamera().setZ(20);
} catch (Exception e) {
e.printStackTrace();
}
// -- set the background color to be transparent
// you need to have called setGLBackgroundTransparent(true); in the activity
// for this to work.
getCurrentScene().setBackgroundColor(0);
}
示例4: getDefaultCubeMapTexture
import org.rajawali3d.materials.textures.CubeMapTexture; //导入依赖的package包/类
protected static ATexture getDefaultCubeMapTexture() {
return new CubeMapTexture("DefaultCubeMapTexture", new Bitmap[] { defaultTextureBitmap, defaultTextureBitmap,
defaultTextureBitmap, defaultTextureBitmap, defaultTextureBitmap, defaultTextureBitmap });
}
示例5: updateSkybox
import org.rajawali3d.materials.textures.CubeMapTexture; //导入依赖的package包/类
/**
* Updates the sky box textures with 6 new resource ids.
*
* @param front int Resource id for the front face.
* @param right int Resource id for the right face.
* @param back int Resource id for the back face.
* @param left int Resource id for the left face.
* @param up int Resource id for the up face.
* @param down int Resource id for the down face.
* @throws Exception
*/
public void updateSkybox(int front, int right, int back, int left, int up, int down) throws Exception {
if(mSkyboxTexture.getClass() != CubeMapTexture.class)
throw new Exception("The skybox texture cannot be updated. It is not a cube map texture.");
int[] resourceIds = new int[] { front, right, back, left, up, down };
CubeMapTexture cubemap = (CubeMapTexture)mSkyboxTexture;
cubemap.setResourceIds(resourceIds);
mRenderer.getTextureManager().replaceTexture(cubemap);
}
示例6: updateSkybox
import org.rajawali3d.materials.textures.CubeMapTexture; //导入依赖的package包/类
/**
* Updates the sky box textures with 6 new resource ids.
*
* @param front int Resource id for the front face.
* @param right int Resource id for the right face.
* @param back int Resource id for the back face.
* @param left int Resource id for the left face.
* @param up int Resource id for the up face.
* @param down int Resource id for the down face.
* @throws Exception
*/
public void updateSkybox(int front, int right, int back, int left, int up, int down) throws Exception {
if(mSkyboxTexture.getClass() != CubeMapTexture.class)
throw new Exception("The skybox texture cannot be updated. It is not a cube map texture.");
int[] resourceIds = new int[] { front, right, back, left, up, down };
CubeMapTexture cubemap = (CubeMapTexture)mSkyboxTexture;
cubemap.setResourceIds(resourceIds);
mRenderer.getTextureManager().replaceTexture(cubemap);
}