"No one can be told what GeeXLab is, you have to see it for yourself!"

"Stop Playing Games and Start Making Them! With GeeXLab, your are on your way!"


Quick Links
What is GeeXLab
Download GeeXLab
GeeXLab Requirements
Online Help
Articles and Tutorials
Samples Screenshots
Videos

GeeXLab Changelog

XML Ref. Guide
Scripting Ref. Guide
Code Samples

Purchase GeeXLab
GeeXLab SDK

Shader Library

Follow GeeXLab's News
GeeXLab news, articles, tutorials and demos @ Geeks3D.com
GeeXLab @ Twitter GeeXLab RSS Feed

Subscribe to GeeXLab news by email

[ Back to Geeks3D.com ]

GeeXLab

GeeXLab

Laboratory for Real Time 3D Programming (prototyping and demos)
OpenGL, Lua, Python, GLSL,
PhysX and more...

Reference Guide
Host-API Lua / Python



Back to Homepage
Back to Developer's Guide Index

HYP_Camera Library


Description
Camera management library

Number of functions: 33

HYP_Camera.Create

Description
Creates a new camera object.

Languages: Lua - Python

Return Values
  • id [INTEGER]: camera id

    Code sample :

    id = HYP_Camera.Create()


    HYP_Camera.Destroy

    Description
    Destroy an existing camera object.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: camera id

    Code sample :

    HYP_Camera.Destroy(id)


    HYP_Camera.SetActiveState

    Description
    Sets camera's active state. The state is set to 1 at the camera creation.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: camera id
  • state [INTEGER]: active state (0 or 1)

    Code sample :

    HYP_Camera.SetActiveState(id)


    HYP_Camera.ApplyToRenderer

    Description
    Applies camera's matrices to renderer.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: camera id

    Code sample :

    HYP_Camera.ApplyToRenderer(id)


    HYP_Camera.UpdateViewMatrix

    Description
    Updates camera's view matrix.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: camera id

    Code sample :

    HYP_Camera.UpdateViewMatrix(id)


    HYP_Camera.SetFOV

    Description
    Sets the field of view (fov) in degrees of a specific camera (id).

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: camera id
  • fov [REAL]: field of view in degrees.

    Code sample :

    HYP_Camera.SetFOV(id, 130.0)


    HYP_Camera.SetFOV_XY

    Description
    Sets the horizontal and vertical field of view (fov) in degrees of a specific camera (id).

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: camera id
  • fovX [REAL]: horizontal fov in degrees.
  • fovY [REAL]: vertical fov in degrees.

    Code sample :

    HYP_Camera.SetFOV_XY(id, 90.0, 130.0)


    HYP_Camera.GetFOV

    Description
    Gets the field of view (fov) in degrees of a specific camera (id).

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: camera id

    Return Values
  • fov [REAL]: field of view in degrees.

    Code sample :

    fov = HYP_Camera.GetFOV(id)


    HYP_Camera.GetPosition

    Description
    Gets camera position.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: camera id

    Return Values
  • pos_x [REAL]: position in X.
  • pos_y [REAL]: position in Y.
  • pos_z [REAL]: position in Z.

    Code sample :

    pos_x, pos_y, pos_z = HYP_Camera.GetPosition(id)


    HYP_Camera.SetPosition

    Description
    Sets the camera position.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: camera id
  • x [REAL]: position in X.
  • y [REAL]: position in Y.
  • z [REAL]: position in Z.

    Code sample :

    HYP_Camera.SetPosition(id, 50.0, -60.0, 200.0)


    HYP_Camera.SetViewParams

    Description
    Allows to change the camera's basic parameters: position, lookat and up vectors.

    Languages: Lua - Python

    Parameters
  • camera_id [INTEGER]: camera id
  • pos_x [REAL]: position in X.
  • pos_y [REAL]: position in Y.
  • pos_z [REAL]: position in Z.
  • lookat_x [REAL]: position in X of the lookat point.
  • lookat_y [REAL]: position in Y of the lookat point.
  • lookat_z [REAL]: position in Z of the lookat point.
  • up_x [REAL]: X component of orientation vector.
  • up_y [REAL]: Y component of orientation vector.
  • up_z [REAL]: Z component of orientation vector.

    Code sample :

    HYP_Camera.SetViewParams(id, pos_x, pos_y, pos_z, lookat_x, lookat_y, lookat_z, up_x, up_y, up_z);


    HYP_Camera.SetTarget

    Description
    Sets the object target (targetId) of a specific camera (id).

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: camera id
  • target_id [INTEGER]: target object id

    Code sample :

    HYP_Camera.SetTarget(id, target_id)


    HYP_Camera.SetPerspectiveProjection

    Description
    Sets the camera's perspective projection. This function also swithes camera from any previous mode to perspective mode.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: camera id
  • fov [REAL]: field of view in degrees
  • aspect [REAL]: aspect ratio (width/height)
  • znear [REAL]: camera z near clipping plane
  • zfar [REAL]: camera z far clipping plane

    Code sample :

    HYP_Camera.SetPerspectiveProjection(id, fov, aspect, znear, zfar)


    HYP_Camera.SetTwoFovPerspectiveProjection

    Description
    Sets the camera's perspective projection. This function also swithes camera from any previous mode to perspective mode.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: camera id
  • fovX [REAL]: horizontal fov in degrees
  • fovY [REAL]: vertical fov in degrees
  • aspect [REAL]: aspect ratio (width/height)
  • znear [REAL]: camera z near clipping plane
  • zfar [REAL]: camera z far clipping plane

    Code sample :

    HYP_Camera.SetPerspectiveProjection(id, fov, aspect, znear, zfar)


    HYP_Camera.SetOrthographicProjection

    Description
    Sets the camera's orthographic projection. This function also swithes camera from any previous mode to orthographic mode.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: camera id
  • left [REAL]: left clipping plane
  • right [REAL]: right clipping plane
  • bottom [REAL]: bottom clipping plane
  • top [REAL]: top clipping plane
  • znear [REAL]: camera z near clipping plane
  • zfar [REAL]: camera z far clipping plane

    Code sample :

    HYP_Camera.SetOrthographicProjection(id, left, right, bottom, top, znear, zfar)


    HYP_Camera.SetViewport

    Description


    Languages: Lua - Python

    Parameters
  • camera_id [INTEGER]: camera id
  • x_offset [INTEGER]: offset in x of the viewport
  • y_offset [INTEGER]: offset in y of the viewport
  • width [INTEGER]: width of viewport.
  • height [INTEGER]: height of viewport.

    Code sample :

    HYP_Camera.SetViewport(camera_id, 0, 0, width, height)


    HYP_Camera.GetViewport

    Description


    Languages: Lua - Python

    Parameters
  • camera_id [INTEGER]: camera numeric identifier as returned by HYP_Object.GetId()

    Return Values
  • offset_x [INTEGER]: offset in x of the viewport.
  • offset_y [INTEGER]: offset in y of the viewport.
  • width [INTEGER]: width of viewport.
  • height [INTEGER]: height of viewport.

    Code sample :

    offset_x, offset_y, width, height = HYP_Camera.GetViewport(camera_id)


    HYP_Camera.GetNumCameras

    Description
    Returns the number of cameras in the scene cameras list.

    Languages: Lua - Python

    Return Values
  • n [INTEGER]: number of cameras in the 3D scene.

    Code sample :

    n = HYP_Camera.GetNumCameras()


    HYP_Camera.GetIdByIndex

    Description
    Returns camera's id from its index in scene cameras list.

    Languages: Lua - Python

    Parameters
  • index [INTEGER]: index of the camera in the cameras list of the 3D scene.

    Return Values
  • id [INTEGER]: camera id

    Code sample :

    id = HYP_Camera.GetIdByIndex(index)


    HYP_Camera.SetBkgColor

    Description
    Changes the background color of the viewport.

    Languages: Lua - Python

    Parameters
  • camera_id [INTEGER]: camera numeric identifier as returned by HYP_Object.GetId()
  • r [REAL]: Red component of color.
  • g [REAL]: Green component of color.
  • b [REAL]: Blue component of color.

    Code sample :

    HYP_Camera.SetBkgColor(camera_id, r, g, b)


    HYP_Camera.SetFarPlane

    Description
    Sets the distance of camera's far clipping plane. The distance is relative to the camera's position.

    Languages: Lua - Python

    Parameters
  • camera_id [INTEGER]: camera id
  • far [REAL]: far clipping plane distance

    Code sample :

    HYP_Camera.SetFarPlane( camera_id, 1000.0 )


    HYP_Camera.GetFarPlane

    Description
    GetFarPlane gets the distance of the far clipping plane of camera. The distance is relative to the camera's position .

    Languages: Lua - Python

    Parameters
  • camera_id [INTEGER]: camera id

    Return Values
  • far [REAL]: distance of the far clipping plane.

    Code sample :

    far = HYP_Camera.GetFarPlane(camera_id)


    HYP_Camera.SetNearPlane

    Description
    SetNearPlane allows to change the distance of the camera's near clipping plane. This distance is relative to the camera's position.

    Languages: Lua - Python

    Parameters
  • camera_id [INTEGER]: camera id
  • near [REAL]: near clipping plane.

    Code sample :

    HYP_Camera.SetNearPlane(camera_id, 1000.0)


    HYP_Camera.GetNearPlane

    Description
    GetNearPlane gets the camera's near clipping plane distance. This distance is relative to the camera's position.

    Languages: Lua - Python

    Parameters
  • camera_id [INTEGER]: camera id

    Return Values
  • near [REAL]: near clipping plane distance.

    Code sample :

    near = HYP_Camera.GetFarPlane(camera_id)


    HYP_Camera.SetLookAt

    Description
    Sets the lookat position.

    Languages: Lua - Python

    Parameters
  • camera_id [INTEGER]: camera id
  • x [REAL]: position in X of the lookat point.
  • y [REAL]: position in y of the lookat point.
  • z [REAL]: position in Z of the lookat point.
  • w [REAL]: Specify wether the {x, y, z} triplet corresponds to a position in space (w=1.0) or to a direction vector (w=0.0).

    Code sample :

    HYP_Camera.SetLookAt(camera_id, 10.0, -30.0, -200.0, 1.0 )


    HYP_Camera.GetLookAtDirection

    Description
    Returns the direction vector of the camera. This vector is a unit vector (normalized).

    Languages: Lua - Python

    Parameters
  • camera_id [INTEGER]: camera numeric identifier as returned by HYP_Object.GetId()

    Return Values
  • x [REAL]: X component of the direction vector
  • y [REAL]: Y component of the direction vector
  • z [REAL]: Z component of the direction vector

    Code sample :

    x, y, z = HYP_Camera.GetLookAtDirection(camera_id)


    HYP_Camera.SetOrientation

    Description
    Sets camera orientation with an angle and a rotation axis.

    Languages: Lua - Python

    Parameters
  • camera_id [INTEGER]: camera id
  • angle [REAL]: angle of rotation in degrees.
  • x [REAL]: component in X of rotation axis.
  • y [REAL]: component in Y of rotation axis.
  • z [REAL]: component in Z of rotation axis.

    Code sample :

    HYP_Camera.SetOrientation(camera_id, -30.0, 0.0, 1.0, 0.0)


    HYP_Camera.SetPitch

    Description
    Sets camera's X-axis rotation.

    Languages: Lua - Python

    Parameters
  • camera_id [INTEGER]: camera id
  • angle [REAL]: Rotation angle in degrees around X axis of the local system.

    Code sample :

    HYP_Camera.SetPitch(camera_id, -30.0)


    HYP_Camera.SetYaw

    Description
    Allows to rotate a camera around its Y axis.

    Languages: Lua - Python

    Parameters
  • camera_id [INTEGER]: camera id
  • angle [REAL]: rotation angle in degrees around Y axis of the local system.

    Code sample :

    HYP_Camera.SetYaw(camera_id, 10.0)


    HYP_Camera.SetRoll

    Description
    Allows to rotate the camera around its Z axis.

    Languages: Lua - Python

    Parameters
  • camera_id [INTEGER]: camera id
  • angle [REAL]: rotation angle in degrees around Z axis des Z of the local system.

    Code sample :

    HYP_Camera.SetRoll(camera_id, 5.0)


    HYP_Camera.GetProjectionMatrix

    Description
    Returns the 4x4 current projection matrix of camera. This matrix uses OpenGL conventions: | m0 m4 m8 m12 | | m1 m5 m9 m13 | | m2 m6 m10 m14 | | m3 m7 m11 m15 |

    Languages: Lua - Python

    Parameters
  • camera_id [INTEGER]: camera numeric identifier as returned by HYP_Object.GetId()

    Return Values
  • m0 .. to .. m15 [REAL]: values of the projection matrix

    Code sample :

    m0,m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,m11,m12,m13,m14,m15 = HYP_Camera.GetProjectionMatrix(camera_id)


    HYP_Camera.GetViewMatrix

    Description
    Returns the 4x4 current view matrix of the camera. This matrix uses OpenGL conventions: | m0 m4 m8 m12 | | m1 m5 m9 m13 | | m2 m6 m10 m14 | | m3 m7 m11 m15 |

    Languages: Lua - Python

    Parameters
  • camera_id [INTEGER]: camera numeric identifier as returned by HYP_Object.GetId()

    Return Values
  • m0 .. to .. m15 [REAL]: values of the view matrix

    Code sample :

    m0,m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,m11,m12,m13,m14,m15 = HYP_Camera.GetViewMatrix(camera_id)


    HYP_Camera.MakeScreenshot

    Description
    Makes a screen capture of the current frame. This screen capture is saved in the directory specified in the configuration file or by the function SetDirForScreenshots().

    Languages: Lua - Python

    Parameters
  • dirname [STRING]: name of Direcoty in which screen captures are stored.

    Code sample :

    HYP_Camera.SetScreenshotsDirectory("dirname")




  • Random Projects

    Pixelation PostFX
    Pixelation PostFX

    Thermal Vision PostFX
    Thermal Vision PostFX

    Posterization Effect
    Posterization Effect


    Random Code Samples

    Mesh Instancing - Spirale
    Mesh Instancing - Spirale

    Model Cloning
    Model Cloning

    HUD (Head Up Display)
    HUD (Head Up Display)



    (C)2009-2010 Geeks3D.com