zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Zeni::Projector3D Class Reference

The 3D Projector. More...

#include <Projector.h>

Inherits Zeni::Projector.

Public Member Functions

 Projector3D (const Camera &camera3d=Camera(), const std::pair< Point2i, Point2i > &viewport=std::make_pair(Point2i(), get_Video().get_render_target_size()))
 
Vector3f project (const Vector3f &world_coord) const
 Map coordinates in the viewing frustum to screen coordinates ([viewport.first.x, viewport.second.x], [viewport.first.y, viewport.second.y], [0, 1]) More...
 
Point3f project (const Point3f &world_coord) const
 Map coordinates in the viewing frustum to screen coordinates ([viewport.first.x, viewport.second.x], [viewport.first.y, viewport.second.y], [0, 1]) More...
 
Vector3f unproject (const Vector3f &screen_coord) const
 Map screen coordinates ([viewport.first.x, viewport.second.x], [viewport.first.y, viewport.second.y], [0, 1]) to coordinates in the viewing frustum. More...
 
Point3f unproject (const Point3f &screen_coord) const
 Map screen coordinates ([viewport.first.x, viewport.second.x], [viewport.first.y, viewport.second.y], [0, 1]) to coordinates in the viewing frustum. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Zeni::Projector
 Projector (const std::pair< Point2i, Point2i > &viewport=std::make_pair(Point2i(), get_Video().get_render_target_size()))
 
 ~Projector ()
 
void init (const std::pair< Point2i, Point2i > &viewport)
 
const Vector3foffset () const
 
const Vector3fsize () const
 

Detailed Description

The 3D Projector.

For converting between world and screen coordinates in 3D

Author
bazald

Contact: bazal.nosp@m.d@ze.nosp@m.nipex.nosp@m..com

Definition at line 109 of file Projector.h.

Constructor & Destructor Documentation

Zeni::Projector3D::Projector3D ( const Camera camera3d = Camera(),
const std::pair< Point2i, Point2i > &  viewport = std::make_pair(Point2i(), get_Video().get_render_target_size()) 
)
inline

Definition at line 99 of file Projector.hxx.

Member Function Documentation

Vector3f Zeni::Projector3D::project ( const Vector3f world_coord) const
inline

Map coordinates in the viewing frustum to screen coordinates ([viewport.first.x, viewport.second.x], [viewport.first.y, viewport.second.y], [0, 1])

Definition at line 106 of file Projector.hxx.

References Zeni::Vector3f::divide_by(), k, Zeni::Projector::offset(), and Zeni::Projector::size().

Referenced by project().

Point3f Zeni::Projector3D::project ( const Point3f world_coord) const
inline

Map coordinates in the viewing frustum to screen coordinates ([viewport.first.x, viewport.second.x], [viewport.first.y, viewport.second.y], [0, 1])

Definition at line 112 of file Projector.hxx.

References project().

Vector3f Zeni::Projector3D::unproject ( const Vector3f screen_coord) const
inline

Map screen coordinates ([viewport.first.x, viewport.second.x], [viewport.first.y, viewport.second.y], [0, 1]) to coordinates in the viewing frustum.

Definition at line 116 of file Projector.hxx.

References Zeni::Vector3f::k, Zeni::Projector::offset(), and Zeni::Projector::size().

Referenced by unproject().

Point3f Zeni::Projector3D::unproject ( const Point3f screen_coord) const
inline

Map screen coordinates ([viewport.first.x, viewport.second.x], [viewport.first.y, viewport.second.y], [0, 1]) to coordinates in the viewing frustum.

Definition at line 121 of file Projector.hxx.

References unproject().


The documentation for this class was generated from the following files: