Panda3D/Manual/Cube Maps: diferenças entre revisões

[edição não verificada][edição não verificada]
Conteúdo apagado Conteúdo adicionado
Criou nova página com 'Existe mais um tipo especial te mapa de textura: o cube map, que é introduzido no Panda3D versão 1.1. O cube map é similar á uma textura 3D, ja que precisa de coordenada...'
 
Sem resumo de edição
Linha 16:
The faces are laid out according to the following diagram:
 
[[Ficheiro:Exploded_cube_map.png]]
The arrangement of the six faces of a cube map
 
Imagine that you cut out the above diagram and folded it into a cube. You'd end up with something like this:
 
[[Ficheiro:Mapped_cube_map_solid.png]]
A solid-mapped cube
 
Note that, when you hold the cube so that the axis indications for each face are in the appropriate direction (as in the picture above), several of the faces are upside-down or sideways. That's because of the way the graphics card manufacturers decided to lay out the cube map faces (and also because of Panda3D's default coordinate system). But in fact, it doesn't matter which way the faces are oriented, as long as you always generate your cube map images the same way.
Linha 26:
In some sense, a cube map is a kind of surface texture, like an ordinary 2-D texture. But in other sense, it is also volumetric like a 3-D texture: every point within the 3-D texture coordinate space is colored according to the face of the cube it comes closest to. A sphere model with the cube map applied to it would pick up the same six faces:
 
[[Ficheiro:Mapped_cube_map.png]]
A wireframe cube, showing the internal mapped space
 
Note that, while a 3-D texture assigns a different pixel in the texture to every point within a volume, a cube map assigns a different pixel in the texture to every direction from the center.
Linha 32:
You can load a cube map from a series of six image files, very similar to the way you load a 3-D texture:
 
tex = loader.loadCubeMap('cubemap_#.png')
 
As with a 3-D texture, the hash mark ("#") in the filename will be filled in with the image sequence number, which in the case of a cube map will be a digit from 0 to 5. The above example, then, will load the six images "cubemap_0.png", "cubemap_1.png", "cubemap_2.png", "cubemap_3.png", "cubemap_4.png", and "cubemap_5.png", and assemble them into one cube map.