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
- __init__(name: str)
- clearColor()
Unsets the color of the card.
- clearSourceGeometry()
Removes the node specified by an earlier call to
setSourceGeometry()
.
- reset()
Resets all the parameters to their initial defaults.
- setFrameFullscreenQuad()
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.
- setHas3dUvs(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.
- setHasNormals(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.
- setHasUvs(flag: bool)
Sets the flag indicating whether vertices will be generated with UV’s or not.
- setSourceGeometry(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 bysetFrame()
.
- setUvRange(ll: LTexCoord, ur: LTexCoord)
Sets the range of UV’s that will be applied to the vertices. If
setHasUvs()
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.
- setUvRange(ll: LTexCoord, lr: LTexCoord, ur: LTexCoord, ul: LTexCoord)
Sets the range of UV’s that will be applied to the vertices. If
setHasUvs()
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.
- setUvRange(ll: LTexCoord3, lr: LTexCoord3, ur: LTexCoord3, ul: LTexCoord3)
Sets the range of UV’s that will be applied to the vertices. If
setHasUvs()
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.
- setUvRange(x: LVector4, y: LVector4, z: LVector4)
Sets the range of UV’s that will be applied to the vertices. If
setHasUvs()
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.
- setUvRange(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.