Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

Camera

The Camera item defines the viewing position and projection for a 3D scene. More...

Inherits QtObject

Camera instantiates the C++ class QGLCamera

This type was introduced in Qt 4.8.

Properties

Detailed Description

Camera instances are defined on a Viewport item using the Viewport::camera property:

 import QtQuick 2.0
 import Qt3D 1.0

 Viewport {
     width: 640; height: 480
     camera: Camera {
         eye: Qt.vector3d(-1, 2, 10)
     }
     light: Light {}
     Item3D {
         mesh: Mesh { source: "meshes/teapot.bez" }
         effect: Effect {}
     }
 }

Positioning and orienting the view

The viewer position and orientation are defined by eye, center, and upVector. The location of the viewer in world co-ordinates is given by eye, the viewer is looking at the object of interest located at center, and the upVector specifies the direction that should be considered "up" with respect to the viewer.

The vector from the eye to the center is called the "view vector", and the cross-product of the view vector and upVector is called the "side vector". The view vector specifies the direction the viewer is looking, and the side vector points off to the right of the viewer.

It is recommended that the view vector and upVector be at right angles to each other, but this is not required as long as the angle between them is close to 90 degrees.

The most common use of view and up vectors that are not at right angles is to simulate a human eye at a specific height above the ground looking down at a lower object or up at a higher object. In this case, the the view vector will not be true horizontal, but the upVector indicating the human's upright stance will be true vertical.

Zooming the camera image

There are two ways to zoom the image seen through the camera: either the camera eye position can be moved closer to the object of interest, or the field of view of the camera lens can be changed to make it appear as though the object is moving closer.

Changing the eye position changes the lighting calculation in the scene because the viewer is in a different position, changing the angle of light reflection on the object's surface.

The fieldOfView property function can be used to simulate the effect of a camera lens. The smaller the fieldOfView, the closer the object will appear. The lighting calculation will be the same as for the unzoomed scene.

If fieldOfView is zero, then a standard perspective frustum of is used to define the viewing volume based on the width and height of the Viewport.

Stereo projections

Camera can adjust the camera position for rendering separate left and right eye images by setting the eyeSeparation property to a non-zero value. The eyeSeparation is in world co-ordinates.

Objects that are placed at center will coincide in the left and right eye images, establishing the logical center of the stereo effect. Objects that are closer to the eye will be rendered to appear closer in the stereo effect, and objects that are further away from eye than center will be rendered to appear further away.

See also Viewport.

Property Documentation

adjustForAspectRatio : bool

The adjustment state of the aspect ratio in the viewing volume.

By default, the camera adjusts the viewing volume for the aspect ratio of the window so that pixels appear square without the application needing to adjust the view size manually.

If this property is false, then the aspect ratio adjustment is not performed.

See also projectionType.


center : vector3D

The center of the view visible from the viewer's position. The default value is (0, 0, 0).

See also eye and upVector.


eye : vector3D

The position of the viewer's eye. The default value is (0, 0, 10).

See also upVector, center, and eyeSeparation.


eyeSeparation : real

The separation between the eyes when stereo viewing is in use, with eye property specifying the mid-point between the eyes. The default value is 0.

See also eye.


farPlane : real

The distance from the eye to the far clipping plane. The default value is 1000.

See also nearPlane.


fieldOfView : real

The field of view in degrees for a perspective projection.

The default value is zero, which indicates a standard perspective frustum view volume.

This value is ignored if projectionType is not Perspective.

See also projectionType.


nearPlane : real

The distance from the eye to the near clipping plane. The default value is 5.

See also farPlane.


projectionType : enumeration

The projection type for this camera, which is one of:

  • Perspective Use a perspective view. This is the default.
  • Orthographic Use an orthographic view.

upVector : vector3D

The up vector for the viewer. The default value is (0, 1, 0).

See also eye and center.


Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 5.0-snapshot
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web