This commit is contained in:
Ada Radius
2020-07-22 12:27:05 -07:00
5 changed files with 26776 additions and 7 deletions
+6 -7
View File
@@ -1,11 +1,10 @@
# R3
This repository is intended for development of a proposal for an additional Character for opensim grids. The artwork in this repository - armature definitions, morph targets, mesh and other data is licensed under https://creativecommons.org/licenses/by-nc/4.0/
This repository is intended for development of a proposal for an additional Character for OpenSimulator grids. The artwork in this repository - armature definitions, morph targets, mesh and other data is licensed under CC-BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/).
Please contact Ada Radius at adaradius@gmail.com for inquiries on commercial use of the artwork.
Please contact Ada Radius at adaradius@gmail.com for enquiries on commercial use of the artwork.
Other references:
http://opensimulator.org/wiki/Main_Page
https://bitbucket.org/lindenlab/viewer/src/master/
http://wiki.secondlife.com/wiki/Linden_Lab_Official:GNU_Lesser_General_Public_License,_version_2.1
* http://opensimulator.org/wiki/Main_Page
* https://bitbucket.org/lindenlab/viewer/src/master/
* http://wiki.secondlife.com/wiki/Linden_Lab_Official:Second_Life_Viewer_Licensing_Program
* https://vcs.firestormviewer.org/phoenix-firestorm
+6
View File
@@ -0,0 +1,6 @@
Dump LLM File
dumpllm.c
Author or source URL?
Permitted usage and licence?
File diff suppressed because it is too large Load Diff
+19496
View File
File diff suppressed because it is too large Load Diff
+175
View File
@@ -0,0 +1,175 @@
//Program to read Linden Labs *.LLM (Linden Labs Binary Mesh 1.0) files
//and dump them out converted to text
//2020-07-21 Kayaker Magic, aka Mike Higgins
#include<stdio.h>
#include<math.h>
#include<string.h>
float f[256]; //buffers for reading various parts
char s[2048];
unsigned short int i[256];
unsigned long int l[256];
#define TITLE 24 //bytes in the heade that say what am I
//note: there is an extra byte after the nul,
//I read it to get to the right spot in file
void dumpfloat(char *name,float *f,int num)
{
printf("%s",name);
int loop;
for (loop=0;loop<num;loop++)
printf(" %12.6f",*f++);
printf("\n");
} //dumpfloat
int main(int argc, char *argv [ ])
{
printf("dump llm file: %s\n",argv[1]);
FILE *ftr = fopen(argv[1],"rb");
unsigned int pos = ftell(ftr);
fread(s,TITLE,1,ftr);
printf("HEADER: %s\n",s);
pos = ftell(ftr);
int hasWeights=0;
fread(&hasWeights,1,1,ftr); //flag indicating if weights section is in file
printf("Has weights: %i\n",hasWeights);
int hasDetailTexCoords=0; //flag indicating if extra detailed texture section in file
fread(&hasDetailTexCoords,1,1,ftr);
printf("Has Detail Tex Coords: %i\n",hasDetailTexCoords);
//Note: I'm using numeric values instead of sizeof(float)
//on purpose because that is how many bytes there are
//in the file.
fread(f,3,4,ftr); //the position (always 0,0,0 for avatar meshes?)
dumpfloat("Position:",f,3);
fread(f,3,4,ftr); //the rotation angles
dumpfloat("Rotation:",f,3);
int rotationOrder=0;
fread(&rotationOrder,1,1,ftr); //rotation order
printf("Rotation Order: %i\n",rotationOrder);
fread(f,3,4,ftr); //scale
dumpfloat("Scale: ",f,3);
int numVertices=0; //number of vertices
fread(&numVertices,1,2,ftr);
printf("Number of Vertices: %i\n",numVertices);
int loop;
for (loop=0;loop<numVertices;loop++)
{
fread(f,4,3,ftr); //read one vertex and print it out
printf(" <%9.6f,%9.6f,%9.6f>",f[0],f[1],f[2]);
if ((loop%4)==3) //every so often
printf("\n"); //break the line
}
printf("\nNormals:\n");
for (loop=0;loop<numVertices;loop++)
{
fread(f,4,3,ftr); //read one normal and print it out
printf(" <%9.6f,%9.6f,%9.6f>",f[0],f[1],f[2]);
if ((loop%4)==3) //every so often
printf("\n"); //break the line
}
printf("\nBinormals:\n");
for (loop=0;loop<numVertices;loop++)
{
fread(f,4,3,ftr); //read one normal and print it out
printf(" <%9.6f,%9.6f,%9.6f>",f[0],f[1],f[2]);
if ((loop%4)==3) //every so often
printf("\n"); //break the line
}
printf("\nTexture Coords:\n");
for (loop=0;loop<numVertices;loop++)
{
fread(f,4,2,ftr); //read one co-ord and print it out
printf(" <%9.6f,%9.6f>",f[0],f[1]);
if ((loop%6)==5) //every so often
printf("\n"); //break the line
}
printf("\nDetail Texture Coords:\n");
if (hasDetailTexCoords)
{
for (loop=0;loop<numVertices;loop++)
{
fread(f,4,2,ftr); //read one co-ord and print it out
printf(" <%9.6f,%9.6f>",f[0],f[1]);
if ((loop%6)==5) //every so often
printf("\n"); //break the line
}
}
else
printf(" NONE.");
printf("\nWeights:\n");
if (hasWeights)
{
for (loop=0;loop<numVertices;loop++)
{
fread(f,4,1,ftr); //read one weight and print it out
printf(" %9.6f",f[0]);
if ((loop%12)==11) //every so often
printf("\n"); //break the line
}
}
else
printf(" NONE.");
int numFaces=0;
fread(&numFaces,2,1,ftr); //how many TRIANGLES
printf("\nNumber of Triangles: %i\n",numFaces);
for (loop=0;loop<numFaces;loop++)
{
fread(i,2,3,ftr); //each face is three vertexes
printf(" (%4i,%4i,%4i)",i[0],i[1],i[2]);
if ((loop%6)==5) //every so often
printf("\n"); //break the line
}
int numSkinJoints=0; //Skin Joints
fread(&numSkinJoints,2,1,ftr);
printf("\nNumber of Skin Joints: %i\n",numSkinJoints);
if (hasWeights)
{
s[64]=0; //add an extra nul just in case
for (loop=0;loop<numSkinJoints;loop++)
{
fread(s,64,1,ftr);
printf(" %s\n",s);
}
}
printf("Morph Section:\n");
while(fread(s,1,64,ftr)==64)
{
if (strcmp(s,"End Morphs")==0)
{
printf(" %s\n",s);
break;
}
fread(&numVertices,4,1,ftr); //each named morph has some verticies
printf(" %s has %i target_vertex,vertex,normal,binormal,uv\n",s,numVertices);
int vindex=0;
for (loop=0;loop<numVertices;loop++)
{
fread(&vindex,4,1,ftr); //each vertex has an index
fread(f,4,11,ftr); //followed by 11 floats, a vector(3), normal(3), binomral(3) and UV(2)
printf(" %4i:<%9.6f,%9.6f,%9.6f> <%9.6f,%9.6f,%9.6f> <%9.6f,%9.6f,%9.6f> (%9.6f,%9.6f)\n",
vindex,f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8],f[9],f[10]);
}
}
int numRemaps=0;
fread(&numRemaps,4,1,ftr);
printf("Vertex Remap Section has %i remaps\n",numRemaps);
for (loop=0;loop<numRemaps;loop++)
{
int src=0;
int dst=0;
fread(&src,4,1,ftr); //why did they switch to 32bit ints?
fread(&dst,4,1,ftr);
printf(" (%4i,%4i)",src,dst);
if ((loop%10)==9)
printf("\n");
}
printf("\nI think I'm done...\n");
fclose(ftr);
return 0;
}