Page 3 of 4

Re: Skeleton Files

Posted: Sun May 12, 2013 4:02 pm
by GoldStar611
Ormu,

I am glad that you have contacted me via PM, I haven't been following the forum for a while :cry:

Let me give you some information on my approach I *had* to take when reading out the SKLT files:

We know that a "command" of 02 is a line, 03 is triangle, and 04 is a square :D I'm not sure if I ever mentioned that or not previously.
What I didn't know is that there are some some strange values like 06 or 08 and 00 that I'm really not sure what to do with those or if my program was getting lost and reading in strange numbers.

I am very excited that my investigational work is usefull :) Where do you think I can help you in your viewer?

Edit: Oh, in my newer LabVIEW skeleton viewer I took another easy step: Convert all trianges, rectangles, etc to lines. Then just draw all lines. Just FYI

Re: Skeleton Files

Posted: Sun May 12, 2013 7:08 pm
by Ormu
Thanks for information GoldStar. Your work is what makes all this stuff possible so thanks again. :D

It seems that at least some of the HUD wireframes (stored in wireless folder) have only lines while the actual models have more complex polygons. I'm not a 3D graphics expert but for me it strongly seems to be related to texture mapping which is likely easier with closed polygons than "open" lines.


You may be already aware of this but I found some documentation about the ANIM subformat of EA85/IFF which might be used in UA models as well although I haven't paid much attention to the other contents of BAS files:

http://en.wikipedia.org/wiki/ANIM

Re: Skeleton Files

Posted: Mon May 13, 2013 5:12 pm
by GoldStar611
Ormu wrote: I'm not a 3D graphics expert but for me it strongly seems to be related to texture mapping which is likely easier with closed polygons than "open" lines.
You are absolutely correct. With a rectangle (vs 4 lines) you can reference that as an "object" then texture that object..almost impossible to do with just lines.

That ANIM wiki is new I swear. I had never seen that before in my life!!! That link is going to the wiki

Re: Skeleton Files

Posted: Sun Jun 09, 2013 4:41 pm
by Ormu
Ok, I did some more coding and now models seem to form properly. I also noticed something interesting - could the POL2 "command" just indicate the number of vertices per polygon? I tried to render Stoudson Bomb (BPcSUPA1.sklt) and there are apparently two unknown commands, both 8. If you look at the bomb from above, the head really is an octagon.

Re: Skeleton Files

Posted: Sun Jun 09, 2013 10:13 pm
by GoldStar611
Wow, that is pretty cool. I will have to investigate that model file.

I would assume that if the "command" is 8 then 16 bytes would follow, (8 refernces to verticies).

As a side note I found some old paper notes about the shading and texture mapping sections the .BAS files have inside them. I'll post them later this week (hopefully).

Re: Skeleton Files

Posted: Mon Jun 10, 2013 1:37 am
by GoldStar611
Ormu,

Yes, there most definitely is an octogon inside that skeleton file...I verified it with my own two eyes :)
stoudson bomb octagon.jpg
Annotated POL2 of Stoudson bomb
stoudson bomb octagon.jpg (120.45 KiB) Viewed 1082 times

Re: Skeleton Files

Posted: Mon Jun 10, 2013 4:22 pm
by Ormu
Excellent. Can we now assume that the vertices of polygons are in order, i.e. so that you can draw lines from a vertex to next without ever drawing diagonals across the polygons? They seem to be but I'd like to be sure. The faces object (which can be used to create solid 3D objects) in VPython can apparently take triangles only so more complex polygons must be decomposed into triangles which will be complicated if there are polygons with improperly ordered vertices.

Here's what I have already done (upside down due to the way of storing coordinates in UA; also note that it contains a nonagon):
gradar-vpython.PNG
gradar-vpython.PNG (29.63 KiB) Viewed 1102 times

Re: Skeleton Files

Posted: Mon Jun 10, 2013 9:26 pm
by GoldStar611
excellent work, just multiply all Y coordinate by -1 and you have flipped it (I think it is Y). Things are inverted for some strange reason in UA

I would assume that within a polygon that each vertex is connected to the next one and that the last vertex is connected to the first vertex.

Texture mapping may prove to be a challenge if Vpython only allows triangles because I know for a fact that rectangles can be referenced from the textures. I have decoded some of the X,Y coordinates on paper some years back.

Any ideas on how we can go from 4 or more coordinate -> multiples of 3? (to do texture mapping)

(also, now if we can just grab those verticies and arrange them into a new vehicle :D)

Re: Skeleton Files

Posted: Tue Jun 11, 2013 10:46 am
by Syldan
Attractive progress ;).

Re: Skeleton Files

Posted: Tue Jun 11, 2013 5:06 pm
by Ormu
Texture mapping may prove to be a challenge if Vpython only allows triangles because I know for a fact that rectangles can be referenced from the textures. I have decoded some of the X,Y coordinates on paper some years back.
Applying custom textures accurately onto faces objects seems to be really troublesome indeed, even with triangles only. It seems that an object (a bunch of faces) can only take a single material parameter so you can't define textures per face and all textures have to be arranged into a single array.
Any ideas on how we can go from 4 or more coordinate -> multiples of 3? (to do texture mapping)
This isn't hard as long as the verticies are ordered as explained. Here's the code that I used to convert any polygon into a set of triangles which is compatible with the faces object:

Code: Select all

def decomposeTriangles(polygon_list):
	
	ret_list = []
	for a in range(0, len(polygon_list)-2):
		ret_list.append(polygon_list[0])
		ret_list.append(polygon_list[a+1])
		ret_list.append(polygon_list[a+2])
		
	return ret_list
Basically, it works like this (vX are tuples of x,y,z coordinates of vertices, like (2.23, 3.5, -2.0)):

Code: Select all

input:
[v0, v1, v2, v3, v4]

output:
[v0, v1, v2,
 v0, v2, v3,
 v0, v3, v4 ]

I did some research with the Stoudson bomb model...

Here are the sector definitions for the bomb in inactive and active state:

Code: Select all

BP_SUPA1.base  skeleton/BPcSUPA1.sklt  0 134  80  0  ; SUPERITEM 1 deaktiviert
BP_SUPA2.base  skeleton/BPCSUPA1.sklt  0 134  80  0  ; SUPERITEM 1 aktiviert
Look at those "base" chunks in SET.bas - they contain references to BP_SUPA1.sklt and BP_SUPA2.sklt. The latter of these has surfaces for the lightning/spark textures while the former does not. And as you probably know the sparks can be passed through.

Now does "c" mean "collision", and does the skeleton part in SDF define the collision box while the base part defines the graphic model? BPcSUPA1.sklt does not have the sparks so it can be used to define the collision boxes of both bombs.

The "c" models seem to have slight differences to the "non-c" models. For example, BP_SUPA1.sklt doesn't have octagons.


...btw, did you know that the Stoudson bomb is made of bricks? :|
stoudson_bricks.png
stoudson_bricks.png (77.27 KiB) Viewed 1070 times