CardMaker

from panda3d.core import CardMaker
class CardMaker

Bases:

Bases: Namable

This class generates 2-d “cards”, that is, rectangular polygons, particularly useful for showing textures etc. in the 2-d scene graph.

Inheritance diagram

Inheritance diagram of CardMaker

__init__(param0: CardMaker)
__init__(name: str)
clear_source_geometry()

Removes the node specified by an earlier call to set_source_geometry().

generate() PandaNode

Generates a GeomNode that renders the specified geometry.

reset()

Resets all the parameters to their initial defaults.

set_color(color: LColor)
set_color(r: float, g: float, b: float, a: float)

Sets the color of the card.

set_frame(frame: LVecBase4)

Sets the size of the card.

set_frame(ll: LVertex, lr: LVertex, ur: LVertex, ul: LVertex)

Sets the size of the card.

set_frame(left: float, right: float, bottom: float, top: float)

Sets the size of the card.

set_frame_fullscreen_quad()

Sets the card to (-1,1,-1,1), which is appropriate if you plan to parent it to render2d and use it as a fullscreen quad.

set_has_3d_uvs(flag: bool)

Sets the flag indicating whether vertices will be generated with 3-component UVW’s (true) or 2-component UV’s (the default, false). Normally, this will be implicitly set by setting the uv_range.

set_has_normals(flag: bool)

Sets the flag indicating whether vertices will be generated with normals or not. Normals are required if you intend to enable lighting on the card, but are just wasted space and bandwidth otherwise, so there is a (slight) optimization for disabling them. If enabled, the normals will be generated perpendicular to the card’s face.

set_has_uvs(flag: bool)

Sets the flag indicating whether vertices will be generated with UV’s or not.

set_source_geometry(node: PandaNode, frame: LVecBase4)

Sets a node that will be copied (and scaled and translated) to generate the frame, instead of generating a new polygon. The node may contain arbitrary geometry that describes a flat polygon contained within the indicated left, right, bottom, top frame.

When generate() is called, the geometry in this node will be scaled and translated appropriately to give it the size and aspect ratio specified by set_frame().

set_uv_range(ll: LTexCoord, ur: LTexCoord)

Sets the range of UV’s that will be applied to the vertices. If set_has_uvs() is true (as it is by default), the vertices will be generated with the indicated range of UV’s, which will be useful if a texture is applied.

set_uv_range(ll: LTexCoord, lr: LTexCoord, ur: LTexCoord, ul: LTexCoord)

Sets the range of UV’s that will be applied to the vertices. If set_has_uvs() is true (as it is by default), the vertices will be generated with the indicated range of UV’s, which will be useful if a texture is applied.

set_uv_range(ll: LTexCoord3, lr: LTexCoord3, ur: LTexCoord3, ul: LTexCoord3)

Sets the range of UV’s that will be applied to the vertices. If set_has_uvs() is true (as it is by default), the vertices will be generated with the indicated range of UV’s, which will be useful if a texture is applied.

set_uv_range(x: LVector4, y: LVector4, z: LVector4)

Sets the range of UV’s that will be applied to the vertices. If set_has_uvs() is true (as it is by default), the vertices will be generated with the indicated range of UV’s, which will be useful if a texture is applied.

set_uv_range(tex: Texture)

Sets the range of UV’s that will be applied to the vertices appropriately to show the non-pad region of the texture.

set_uv_range_cube(face: int)

Sets the range of UV’s that will be applied to the vertices appropriately for a cube-map face.