Single Surface and Anim mesh
Blitz3D Forums/Blitz3D Programming/Single Surface and Anim mesh
| ||
If I load a mesh with lots of children as an animmesh, and they all use the same texture, will there only be one surface. e.g. 1. rob.b3d has 3 cubes, called "cube1","cube2" and "cube3" as group names in Milkshape. All are mapped to one texture 2. I load in the mesh=LoadAnimMesh("rob.b3d") 3. I use FindChild() and recurse to get each child and assign to a variable mesh=LoadAnimMesh("rob.b3d") cube1=FindChild(mesh,"cube1") cube2=FindChild(mesh,"cube2") cube3=FindChild(mesh,"cube3") 4. Although I will use cube1,cube2, and cube3, is there still only one surface used as they share the same texture, or have 3 surfaces been created? |
| ||
In this case there are three surfaces. This works because there are three individual meshes and surfaces cannot be shared across meshes, even if they belong to the same group of entities. |
| ||
Ok, basically I am writing a 3D Text system, but I will write functions to create a mesh and add triangles on the fly, pointing to the same surface and manipulate the vertices Cheers |
| ||
Hi Rob, I'm not sure if it is of any help. But i created a 3d text system myself. It just creates a quad for each letter and then applies the same animated texture. eg. letter_texture=loadanimtexture... for n=1 to len(text$) new_quad=create_quad() letter=asc(mid$(text$,n,1) entitytexture new_quad, letter_texture, letter next Greeting, Ghislain |
| ||
many thanks for all your help |
| ||
Rob - why don't you take a look at the way FONText does it? You have the include file and examples. |
| ||
I've started on this feature aswell now, storing the font in a single texture and adding quads to a mesh with texture coordinates set for each letter...very early days atm. The hardest (time consuming) bit is setting the tex coordinates for each letter since in a truetype font they are different widths. I may end up with a simple data statement holding the coords. |
| ||
Thanks for all the advice. I have got it working, a full text system based on a single texture, where quads are added for each letter (one surface), and manipulated using 2D -> 3D Coardinates. Tested with 960 quads, 0 slowdown, demo soon. P.S. Use VertexColor to get smooth gradient |