PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University. More...
#include "projectionScreen.h"
#include "geomNode.h"
#include "transformState.h"
#include "workingNodePath.h"
#include "switchNode.h"
#include "geom.h"
#include "geomTristrips.h"
#include "geomVertexWriter.h"
#include "geomVertexReader.h"
#include "geomVertexRewriter.h"
#include "config_distort.h"
#include "cullTraverserData.h"
Go to the source code of this file.
Functions | |
PT (GeomNode) ProjectionScreen | |
Synthesizes a polygon mesh based on the projection area of the indicated projector. More... | |
PT (PandaNode) ProjectionScreen | |
Generates a deep copy of the hierarchy at the ProjectionScreen node and below, with vertices flattened into two dimensions as if they were seen by the indicated camera node. More... | |
PT (Geom) ProjectionScreen | |
Makes a new Geom, just like the given one, except flattened into two dimensions as seen by the indicated lens. More... | |
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
All rights reserved.
All use of this software is subject to the terms of the revised BSD license. You should have received a copy of this license along with this source code in a file named "LICENSE."
Definition in file projectionScreen.cxx.
PT | ( | GeomNode | ) |
Synthesizes a polygon mesh based on the projection area of the indicated projector.
Makes a new GeomNode, just like the given one, except flattened into two dimensions as seen by the indicated camera.
This generates and returns a new GeomNode but does not automatically parent it to the ProjectionScreen node; see regenerate_screen().
The specified projector need not be the same as the projector given to the ProjectionScreen with set_projector() (although this is often what you want).
num_x_verts and num_y_verts specify the number of vertices to make in the grid across the horizontal and vertical dimension of the projector, respectively; distance represents the approximate distance of the screen from the lens center.
The fill_ratio parameter specifies the fraction of the image to cover. If it is 1.0, the entire image is shown full-size; if it is 0.9, 10% of the image around the edges is not part of the grid (and the grid is drawn smaller by the same 10%). This is intended to work around graphics drivers that tend to show dark edges or other unsatisfactory artifacts around the edges of textures: render the texture larger than necessary by a certain fraction, and make the screen smaller by the inverse fraction.
Definition at line 153 of file projectionScreen.cxx.
PT | ( | PandaNode | ) |
Generates a deep copy of the hierarchy at the ProjectionScreen node and below, with vertices flattened into two dimensions as if they were seen by the indicated camera node.
This is useful for rendering an image as seen through a non-linear lens. The resulting mesh will have vertices in the range [-1, 1] in both x and y, and may be then rendered with an ordinary orthographic lens, to generate the effect of seeing the image through the specified non-linear lens.
The returned node has no parent; it is up to the caller to parent it somewhere or store it so that it does not get dereferenced and deleted.
Definition at line 266 of file projectionScreen.cxx.
PT | ( | Geom | ) |
Makes a new Geom, just like the given one, except flattened into two dimensions as seen by the indicated lens.
Any triangle in the original mesh that involves an unprojectable vertex is eliminated.
Definition at line 665 of file projectionScreen.cxx.
References PfmFile::calc_bilinear_point(), GeomVertexReader::get_data3(), GeomVertexRewriter::is_at_end(), Geom::make_copy(), Lens::project(), and Geom::set_vertex_data().