Camera

Methods: com.aspose.threed (aspose-3d-foss 26.1.0)

Camera bir Entity 3B sahnede bir bakış noktasını tanımlayan bir şeydir. Sahnenin 2B görüntü düzlemine nasıl yansıtıldığını kontrol eder. Bir kamera bir Node konumlandırmak ve sahnedeki yönünü ayarlamak için.

public class Camera extends Entity

Methods

A3DObject -> SceneObject -> Entity -> Camera


Uygulama Notları

Java FOSS sürümünde, Camera sınıf yalnızca yapıcılar içerir — kamera‑özel özellikler (görüş alanı, yakın/uzak düzlem, projeksiyon modu) uygulanmaz.

Dışa aktarma sınırlaması: Kamera varlıkları yazılmaz sahneler dışa aktarılırken. glTF dışa aktarıcı (GltfExporter) yalnızca Mesh varlıkları işler — Kamera düğümleri sessizce atlanır. Bu, bir düğüme eklenmiş bir kameranın dışa aktarılan hiçbir dosyada görünmeyeceği anlamına gelir. Aşağıdaki “Read Camera After Import” örneği, bir içe aktarılan dosyadan kamera adlarının nasıl okunacağını gösterir; ancak, kameraları yeni bir dosyaya geri yazma bu sürümde desteklenmez.


Methods

Camera()
Camera(String name)
NameTypeAccessDescription
apertureModeApertureModeReadGets the aperture mode.
fieldOfViewdoubleReadGets the field of view.
fieldOfViewXdoubleReadGets the field of view x.
fieldOfViewYdoubleReadGets the field of view y.
widthdoubleReadGets the width.
heightdoubleReadGets the height.
aspectRatiodoubleReadGets the aspect ratio.
magnificationVector2ReadGets the magnification.
projectionTypeProjectionTypeReadGets the projection type.
rotationModeRotationModeReadGets the frustum’s orientation mode This property only works when the getTarget() is null.
nearPlanedoubleReadGets the frustum’s near plane distance.
farPlanedoubleReadGets the frustum’s far plane distance.
aspectdoubleReadGets the aspect ratio of the frustum @return the aspect ratio of the frustum /
orthoHeightdoubleReadGets the height when frustum in orthographic projection.
upVector3ReadGets the up direction of the camera @return the up direction of the camera /
lookAtVector3ReadGets the the interested position that the camera is looking at.
directionVector3ReadGets the direction that the camera is looking at.
targetNodeReadGets the target that the camera is looking at.
parentNodeNodeReadGets the parent node.
parentNodesArrayList<Node>ReadGets the parent nodes.
excludedbooleanReadGets the excluded.
boundingBoxBoundingBoxReadGets the bounding box.
sceneSceneReadGets the scene.
nameStringReadGets the name.
propertiesPropertyCollectionReadGets the properties.

Methods

Kamera, tüm özellikleri şuradan devralır: Entity ve A3DObject. Bu sürümde ek format‑özel özellikler sunulmaz.

SignatureDescription
Camera()Creates a new camera instance with default name and properties
Camera(projectionType: ProjectionType)Calls Camera(projectionType) on this Camera instance.
Camera(name: String)Calls Camera(name) on this Camera instance.
Camera(name: String, projectionType: ProjectionType)Calls Camera(name, projectionType) on this Camera instance.
getApertureMode()ApertureModeReturns the aperture mode.
setApertureMode(value: ApertureMode)Sets the aperture mode value.
getFieldOfView()doubleReturns the field of view.
setFieldOfView(value: double)Sets the field of view value.
getFieldOfViewX()doubleReturns the field of view x.
setFieldOfViewX(value: double)Sets the field of view x value.
getFieldOfViewY()doubleReturns the field of view y.
setFieldOfViewY(value: double)Sets the field of view y value.
getWidth()doubleReturns the width.
setWidth(value: double)Sets the width value.
getHeight()doubleReturns the height.
setHeight(value: double)Sets the height value.
getAspectRatio()doubleReturns the aspect ratio.
setAspectRatio(value: double)Sets the aspect ratio value.
getMagnification()Vector2Returns the magnification.
setMagnification(value: Vector2)Sets the magnification value.
getProjectionType()ProjectionTypeReturns the projection type.
setProjectionType(value: ProjectionType)Sets the projection type value.
getRotationMode()RotationModeGets the frustum’s orientation mode This property only works when the getTarget() is null.
setRotationMode(value: RotationMode)Sets the frustum’s orientation mode This property only works when the getTarget() is null.
getNearPlane()doubleGets the frustum’s near plane distance.
setNearPlane(value: double)Sets the frustum’s near plane distance.
getFarPlane()doubleGets the frustum’s far plane distance.
setFarPlane(value: double)Sets the frustum’s far plane distance.
getAspect()doubleGets the aspect ratio of the frustum @return the aspect ratio of the frustum /
setAspect(value: double)Sets the aspect ratio of the frustum @param value New value /
getOrthoHeight()doubleGets the height when frustum in orthographic projection.
setOrthoHeight(value: double)Sets the height when frustum in orthographic projection.
getUp()Vector3Gets the up direction of the camera @return the up direction of the camera /
setUp(value: Vector3)Sets the up direction of the camera @param value New value /
getLookAt()Vector3Gets the the interested position that the camera is looking at.
setLookAt(value: Vector3)Sets the the interested position that the camera is looking at.
getDirection()Vector3Gets the direction that the camera is looking at.
setDirection(value: Vector3)Sets the direction that the camera is looking at.
getTarget()NodeGets the target that the camera is looking at.
setTarget(value: Node)Sets the target that the camera is looking at.
Entity()NURBS curve is a curve represented by NURBS(Non-uniform rational basis spline), A NURBS curve is defined by its getOrder(), a set of weighted Geometry.getControlPoints() and a getKnotVectors() The w component in control point is used as control point’s weight, whatever it is a CurveDimension.TWO_DIMENSIONAL or CurveDimension.THREE_DIMENSIONAL
getParentNode()NodeConstructor of instance.
setParentNode(value: Node)The Boolean operator used in the operation to create the result mesh.
getParentNodes()ArrayList<Node>Protected constructor to allow derived classes to set name.
getExcluded()booleanThe Boolean operator used in the operation to create the result mesh.
setExcluded(value: boolean)Sets the excluded value.
getBoundingBox()BoundingBoxThe first operand of the Boolean operator.
SceneObject()Boolean operator allows you to apply Boolean operation on two IMeshConvertible instances.
getScene()SceneConstructor of BooleanOperator.
A3DObject()Parameterized Cylinder. It can also be used to represent a cone when one of radiusTop/radiusBottom is zero.
getName()StringThe segments of the curve.
setName(name: String)Constructs a CircleShape profile with specified radius.
getProperties()PropertyCollectionInitializes a new instance of Cylinder class.
findProperty(name: String)PropertyInitializes a new instance of the Bone class.
getProperty(name: String)ObjectGets the transform matrix of the node in current pose.
setProperty(name: String, value: Object)Gets the width segments.
removeProperty(name: String)booleanGets flip coordinate system of control points/normal during importing/exporting.

Kullanım Örnekleri

Kamerayı bir sahneye ekle

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");

İçe Aktarımdan Sonra Kamerayı Oku

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());
    }
}

Ayrıca Bakınız

 Türkçe