Configuration reference

This documentation was generated with the assistance of AI. Please report any inaccuracies.

All properties belong to com.irurueta.android.gl.cube.CubeTextureView. Every setter requests a new frame. "Needs surface" means that the property can only be set once the OpenGL surface exists (see Waiting for the surface); otherwise IllegalStateException is thrown.

Properties

Property Type Default Needs surface Description

onSurfaceChangedListener

OnSurfaceChangedListener?

null

No

Notified when the OpenGL surface is created or resized.

cubeSize

Float

1.0f

No

Length of the cube edges. Must not be negative.

cubePosition

Point3D

(0, 0, 2)

No

Position of the cube center in world coordinates.

cubeRotation

Rotation3D

Identity

No

Orientation of the cube.

clearColor

Int (ARGB)

Color.TRANSPARENT

No

Color used to clear the scene.

diffuseColor

Int (ARGB)

Color.rgb(127, 127, 127)

No

Diffuse lighting color. Only used when normals are available.

nearPlane

Float

0.1f

Yes

Near clipping plane.

farPlane

Float

1000.0f

Yes

Far clipping plane.

camera

PinholeCamera?

Default camera for the surface size

Yes

Camera used to render the scene (y axis upwards).

cameraIntrinsicParameters

PinholeCameraIntrinsicParameters?

-

Yes

Intrinsic parameters of camera.

cameraCenter

Point3D?

-

Yes

Center of camera.

cameraRotation

Rotation3D?

-

Yes

Rotation of camera.

orientation

CameraToDisplayOrientation

ORIENTATION_UNKNOWN

Yes

Display orientation used to compute the view camera.

viewCamera

PinholeCamera?

null

Yes

Camera expressed in Android view coordinates (y axis downwards). Requires a known orientation.

viewCameraIntrinsicParameters, viewCameraCenter, viewCameraRotation

-

-

Yes

Individual parameters of viewCamera. Require a known orientation.

Methods

Method Description

setNearFarPlanes(nearPlane: Float, farPlane: Float)

Sets both clipping planes. Needs surface.

setValues(nearPlane: Float, farPlane: Float, camera: PinholeCamera)

Sets both clipping planes and the camera at once. Needs surface. May throw CameraException.

onResume(), onPause()

Inherited from GLTextureView. Resume and pause the rendering thread; call them from the activity or fragment lifecycle.

Constants

Defined in the companion object of com.irurueta.android.gl.cube.CubeRenderer:

Constant Value Description

DEFAULT_CUBE_SIZE

1.0f

Default cube size.

DEFAULT_CUBE_DISTANCE

2.0

Default z coordinate of the cube center.

DEFAULT_NEAR_PLANE

0.1f

Default near clipping plane.

DEFAULT_FAR_PLANE

1000.0f

Default far clipping plane.

DEFAULT_CLEAR_COLOR

Color.TRANSPARENT

Default clear color.

OpenGL configuration

The view always creates an OpenGL ES 2.0 context with an RGBA 8888 configuration, a 16 bit depth buffer and no stencil buffer, sets isOpaque = false so the background is transparent, and renders in RENDER_MODE_WHEN_DIRTY.