Camera — Aspose.3D FOSS for Java
Package: com.aspose.threed (aspose-3d-foss 26.1.0)
Camera is an Entity that defines a viewpoint in a 3D scene. It controls how the scene is projected onto a 2D image plane. A camera is attached to a Node to position and orient it in the scene.
public class Camera extends EntityInheritance
A3DObject -> SceneObject -> Entity -> Camera
Implementation Notes
In the Java FOSS edition, the Camera class does not expose format-specific properties beyond the inherited getName() and property collection from Entity / A3DObject. Camera data imported from 3D files (glTF, FBX) is preserved in the scene graph and re-exported to formats that support it.
Constructor
Camera()
Camera(String name)| Parameter | Type | Default | Description |
|---|---|---|---|
name | String | null | Optional name for the camera. |
Properties
Camera inherits all properties from Entity and A3DObject. No additional format-specific properties are exposed in this edition.
| Property | Type | Getter | Setter | Description |
|---|---|---|---|---|
name | String | getName() | setName(String) | Name of the camera object. |
parentNode | Node | getParentNode() | setParentNode(Node) | The node this camera is attached to. |
excluded | boolean | getExcluded() | setExcluded(boolean) | When true, this entity is excluded from export. |
Usage Examples
Attach a Camera to a Scene
import com.aspose.threed.*;
Scene scene = new Scene();
Camera cam = new Camera("MainCamera");
Node node = scene.getRootNode().createChildNode("camera", cam);
node.getTransform().setTranslation(0.0, 5.0, 20.0);
scene.save("scene-with-camera.glb");Read Camera After Import
import com.aspose.threed.*;
Scene scene = new Scene();
scene.open("model.glb");
for (Node node : scene.getRootNode().getChildNodes()) {
if (node.getEntity() instanceof Camera) {
Camera cam = (Camera) node.getEntity();
System.out.println("Camera: " + cam.getName());
}
}