fsgregs wrote:Hi everyone:
I would like to try learning how to design an add-on using sprites. FYI, I know absolutely nothing about CMOD's or drawing graphics.
1. Is there a tutorial anywhere for how to use sprites to design an add-on in Celestia?
Thanks in advance for your advice
Frank
Ehi Frank, They have left you alone here? Hope this can contribute a bit more. Sprites modelling is both easy and difficult.
Sprites acts on points (vertex) so you need modellers which manages points as primitives. They could be both 3d modelers in
strictly sense or math software with cloud points analysis (and 3d graphics outputs as "save as").
The CMOD structure of a tipical "sprite" prism is below:
material
diffuse 1 1 1
opacity 1
texture0 "your_texture.*" # usual Celestia formats
end_material
mesh
vertexdesc
position f3
pointsize f1 # Note here: standard CMOD doesnt'have
end_vertexdesc
vertices 6
4 0 0 1 # note the "1", specify the pointsizes (standard CMODs doesn't have)
-4 0 0 1
0 4 0 1
0 -4 0 1
0 0 4 1
0 0 -4 1
sprites
0 6 # zero + N(vertex) [uncount zero]
0 1 2 4 5 # N(sprites - 1) = N(vertex) [count zero]
Note:
1) texture format for sprites have the same default attitude: 32bit PNG will hold the transparency parts if any; JPG, which
doesn't allow trasparency needs to be blended as "add": es.
material
diffuse 1 1 1
opacity 1
texture0 "your_texture.*"
blend add
end_material
.
.
.
in order to fade the black background (with the new CMOD blend multiply directive the things will be much better)
Now: how to make this prism whether your modeller doesn't manage points?
1) you write they manually (tedious, just for small number)
2) Automate a spread sheet function (whether you know how to do)
3) Make you prism as polys normally and the remove faces. How to?
3a) Make prism, sphere, cylinder or spacecraft
(yes, even spacecrafts)
3b) Save it as .OBJ or 3ds ASCII
3c) Open the file in a editor and remove all entry that isn't vertex relate (to say, just mem vertex numbers and take points)
3d) paste it in a new text file (figure out the CMOD structure as above)
3e) add all that lacking to be similar to the example above (pointsize, the "1" and the n of sprites)
3e1) For lots of
vertex you need to paste vertex in a spread sheet column bring to mind that the
pointsize will be the second column.
3e2) For having big numbers of
point sprites to merge at end of file, either write a routine within the spreadsheet program or "sage" an exant point sprites file (add-on creators). This method for
pointsize is more difficult because when you try to take it, you copy also the vertex. A way to avoid all this is to add ";" (without quotes) in place of space with an editor and then save it as .CSV. Some spreadsheets recognize this convenction and put columns where are ";".
This is my contribution. Enjoy, Frank!