Panda Manual > Colours and Textures
Colours and TexturesA model has one texture (a picture, or none) and a list of colours. Every face has one of the colours. Panda shows each face as its colour times the texture:
So you can make a model with no texture at all - just coloured faces, which suits a low-poly look - or one texture for the whole model, with colours to tint parts of it. A face's place on the texture is set by its texture coordinates (one for each corner), which the Texture Coordinate Editor arranges.
To see colours and the texture in a view, set its drawing (the second list on the view's top bar) to Flat or Textured. Wireframe shows only edges.
The Colours box on the Materials tab lists the model's colours, each with a swatch, its red, green, blue (or "White") and how many faces have it. Click a colour to pick it.
| Add... | Choose a new colour; it's added to the list and picked. (A new model has no colours, and its faces are white. The first time you add one, Panda puts White in the list first so your existing faces stay white.) Then select faces and click Apply to Selection. |
| Edit... | Changes the picked colour - every face with it changes. Double-clicking a colour does the same. |
| Apply to Selection | Gives the selected faces the picked colour. |
| Select Faces | Selects every (shown) face that has the picked colour - handy to find them, or to change them all to something else. |
| Delete | Takes the colour out of the list. Its faces get the first colour in the list. |
Everything here can be undone.
The Texture box shows the texture (over a chequerboard, so see-through parts show), with its name.
| Load... | Choose a .png, .jpg,
.bmp or .tga as the model's texture. It replaces any texture the model had.
.png is best: it keeps see-through parts, and BambooBasic loads it everywhere. |
| Remove | Takes the texture off; the faces show just their colours. |
| Texture Coordinate Editor... | Opens the editor below (also Face > Texture Coordinate Editor, Ctrl+U). |
See-through parts: a pixel that's more than half see-through isn't drawn at all, and the rest are drawn solid - there's no half-transparency. That's how leaves, fences and hair cards work: a flat plane with a picture that's see-through round the edges.
This window lays faces out on the texture: it decides which part of the picture each face shows. It shows the texture with the faces' outlines drawn over it, and a yellow square at each corner.
Which faces it works on: the faces selected in the views - or, if none are selected, every shown face. The line under the picture says which. Select faces in the main window while it's open and it follows.
Points: corners of neighbouring faces that share both a vertex and a place on the texture are one point, so a layout with no seams moves as one piece. Where the texture has a seam (the same vertex at two places on the picture) the corners are separate points.
Tools| Select | Click a point to select it; drag a box round several. Shift adds, Ctrl takes away. Drag a selected point to move all the selected points. |
| Move | Drag anywhere to move the selected points (all of them if none are selected). Hold Shift to keep to one direction. |
| Rotate | Drag left or right to turn the selected points about their middle. Shift turns in 15-degree steps. |
| Scale | Drag right or up to grow, left or down to shrink. Shift scales one way only. |
| Flip Left <-> Right | Mirrors them across their middle. |
| Flip Up <-> Down | Mirrors them top to bottom. |
| Turn 90 Degrees | A quarter turn clockwise about their middle. |
| Fit to Texture | Stretches them to fill the whole picture. |
| From the Front | As the Front view sees them, filling the picture - like projecting the picture onto the model from the front. Good for a face, a sign, the front of something. |
| From the Left | As the Left view sees them. |
| From the Top | As the Top view sees them - good for ground and roofs. |
| Box (Each Side) | Each face from the side it faces most (front, back, left, right, top or bottom), every side filling the picture. Good for boxy things - crates, buildings, a quick start for anything. |
Closing the window only hides it; it opens again as you left it. Texture coordinates go from 0 to 1 across the picture, from its top left corner; the blue dashed square is that area. Panda's views repeat the picture outside it, but keep your points inside it so the model looks the same in every program.
A typical way to texture a model: select one part (say the front of a head), From the Front, then Scale and Move the points onto the part of the picture you painted for it. Select the next part, and so on. Paint your texture so each part has its own area.
.bb3d. If the
texture is already in the export folder, its name is used as it is; otherwise Panda writes a copy
called <model name>.png there. Keep the picture with the .bb3d._TextureFile); your program loads the picture itself..bb3d: b2dMeshTexture(mesh) gives you the texture as an image
(loaded for you), b2dMeshFaceU/V(mesh, face, corner) each corner's place on it, and
b2dMeshFaceR/G/B(mesh, face) each face's colour. Your drawing code decides how to use
them - b2dDrawImageQuadDepthUV for textured faces, b2dSetColor +
b2dDrawQuadDepth for coloured ones. See Using Models._PR/_PG/_PB[_FM[f]] and the texture
coordinates in _FUV[]; _Draw uses them for you. See
BambooBasic Code Export.