RecordedCamera
A camera that is moving along a predetermined path.
Target: Sofa.Component.Visual
namespace: sofa::component::visual
parents:
BaseCamera
Data:
| Name | Description | Default value |
|---|---|---|
| name | object name | unnamed |
| printLog | if true, emits extra messages at runtime. | 0 |
| tags | list of the subsets the objet belongs to | |
| bbox | this object bounding box | |
| componentState | The state of the component among (Dirty, Valid, Undefined, Loading, Invalid). | Undefined |
| listening | if true, handle the events, otherwise ignore the events | 0 |
| position | Camera's position | |
| orientation | Camera's orientation | |
| lookAt | Camera's look at | |
| distance | Distance between camera and look at | |
| fieldOfView | Camera's FOV | 45 |
| zNear | Camera's zNear | 0.01 |
| zFar | Camera's zFar | 100 |
| computeZClip | Compute Z clip planes (Near and Far) according to the bounding box | 1 |
| minBBox | minBBox | 0 0 0 |
| maxBBox | maxBBox | 1 1 1 |
| widthViewport | widthViewport | 800 |
| heightViewport | heightViewport | 600 |
| projectionType | Camera Type (0 = Perspective, 1 = Orthographic) | |
| activated | Camera activated ? | 1 |
| fixedLookAt | keep the lookAt point always fixed | 0 |
| modelViewMatrix | ModelView Matrix | |
| projectionMatrix | Projection Matrix | |
| zoomSpeed | Zoom Speed | 250 |
| panSpeed | Pan Speed | 0.1 |
| pivot | Pivot (0 => Scene center, 1 => World Center | 0 |
| startTime | Time when the camera moves will start | 0 |
| endTime | Time when the camera moves will end (or loop) | 200 |
| rotationMode | If true, rotation will be performed | 0 |
| translationMode | If true, translation will be performed | 0 |
| navigationMode | If true, navigation will be performed | 0 |
| rotationSpeed | rotation Speed | 0.1 |
| rotationCenter | Rotation center coordinates | |
| rotationStartPoint | Rotation start position coordinates | |
| rotationLookAt | Position to be focused during rotation | |
| rotationAxis | Rotation axis | 0 1 0 |
| cameraUp | Camera Up axis | 0 0 0 |
| cameraPositions | Intermediate camera's positions | |
| cameraOrientations | Intermediate camera's orientations | |
| Visualization | ||
| drawRotation | If true, will draw the rotation path | 0 |
| drawTranslation | If true, will draw the translation path | 0 |
Links:
| Name | Description |
|---|---|
| context | Graph Node containing this object (or BaseContext::getDefault() if no graph is used) |
| slaves | Sub-objects used internally by this object |
| master | nullptr for regular objects, or master object for which this object is one sub-objects |
Examples
Component/Visual/RecordedCamera.scn
<!-- For more details see: https://wiki.sofa-framework.org/tdev/wiki/Notes/NewLoaderArchitecture -->
<Node name="Root" gravity="0 -9.81 0" dt="0.15">
<RequiredPlugin name="Sofa.Component.Collision.Detection.Algorithm"/> <!-- Needed to use components [BVHNarrowPhase BruteForceBroadPhase CollisionPipeline] -->
<RequiredPlugin name="Sofa.Component.Collision.Detection.Intersection"/> <!-- Needed to use components [MinProximityIntersection] -->
<RequiredPlugin name="Sofa.Component.Collision.Response.Contact"/> <!-- Needed to use components [CollisionResponse] -->
<RequiredPlugin name="Sofa.Component.IO.Mesh"/> <!-- Needed to use components [MeshOBJLoader] -->
<RequiredPlugin name="Sofa.Component.Visual"/> <!-- Needed to use components [RecordedCamera VisualStyle] -->
<RequiredPlugin name="Sofa.GL.Component.Rendering3D"/> <!-- Needed to use components [OglModel] -->
<DefaultAnimationLoop/>
<VisualStyle displayFlags="showVisual" />
<CollisionPipeline name="DefaultCollisionPipeline" verbose="0" draw="0" depth="6" />
<BruteForceBroadPhase/>
<BVHNarrowPhase/>
<MinProximityIntersection name="Proximity" alarmDistance="0.8" contactDistance="0.64" />
<CollisionResponse name="Response" response="PenalityContactForceField" />
<!-- <InteractiveCamera name="cam" position="0 0 0" lookAt="0 -1 1"/> -->
<RecordedCamera name="cam" position="0 10 0" rotationLookAt="0 30 0" rotationStartPoint="0 100 100" rotationCenter="0 100 0" listening="true" endTime="1000" drawRotation="1" rotationMode="1" />
<Node name="Model 3D">
<MeshOBJLoader name="meshLoader_0" scale="10" translation="10 15 0"filename="mesh/liver-smoothUV.obj" handleSeams="1" />
<OglModel name="VisualModel" texturename="textures/RustySteel.bmp" src="@meshLoader_0" />
</Node>
<Node name="floor">
<MeshOBJLoader name="meshLoader_1" filename="mesh/floor.obj" scale3d="1 1 1" translation="0 0 0" handleSeams="1" />
<OglModel name="VisualModel" src="@meshLoader_1" texturename="textures/ice_chess.bmp" />
</Node>
</Node>
def createScene(rootNode):
Root = rootNode.addChild('Root', gravity="0 -9.81 0", dt="0.15")
Root.addObject('RequiredPlugin', name="Sofa.Component.Collision.Detection.Algorithm")
Root.addObject('RequiredPlugin', name="Sofa.Component.Collision.Detection.Intersection")
Root.addObject('RequiredPlugin', name="Sofa.Component.Collision.Response.Contact")
Root.addObject('RequiredPlugin', name="Sofa.Component.IO.Mesh")
Root.addObject('RequiredPlugin', name="Sofa.Component.Visual")
Root.addObject('RequiredPlugin', name="Sofa.GL.Component.Rendering3D")
Root.addObject('DefaultAnimationLoop')
Root.addObject('VisualStyle', displayFlags="showVisual")
Root.addObject('CollisionPipeline', name="DefaultCollisionPipeline", verbose="0", draw="0", depth="6")
Root.addObject('BruteForceBroadPhase')
Root.addObject('BVHNarrowPhase')
Root.addObject('MinProximityIntersection', name="Proximity", alarmDistance="0.8", contactDistance="0.64")
Root.addObject('CollisionResponse', name="Response", response="PenalityContactForceField")
Root.addObject('RecordedCamera', name="cam", position="0 10 0", rotationLookAt="0 30 0", rotationStartPoint="0 100 100", rotationCenter="0 100 0", listening="true", endTime="1000", drawRotation="1", rotationMode="1")
Model 3D = Root.addChild('Model 3D')
Model 3D.addObject('MeshOBJLoader', name="meshLoader_0", scale="10", translation="10 15 0", filename="mesh/liver-smoothUV.obj", handleSeams="1")
Model 3D.addObject('OglModel', name="VisualModel", texturename="textures/RustySteel.bmp", src="@meshLoader_0")
floor = Root.addChild('floor')
floor.addObject('MeshOBJLoader', name="meshLoader_1", filename="mesh/floor.obj", scale3d="1 1 1", translation="0 0 0", handleSeams="1")
floor.addObject('OglModel', name="VisualModel", src="@meshLoader_1", texturename="textures/ice_chess.bmp")