Page 2 of 2

Re: .KRV extension in Wii Models?

Posted: Mon Oct 25, 2010 9:24 pm
by Quetzalcoatil
FurryFan,

So I exported an Ogre3d mesh.xml file from the initial blender cube in 2.49b. And got this:

Code: Select all

<mesh>
	<submeshes>
		<submesh material="Material" usesharedvertices="false">
			<faces count="12">
				<face v1="0" v2="1" v3="2"/>
				<face v1="0" v2="2" v3="3"/>
				<face v1="4" v2="5" v3="7"/>
				<face v1="5" v2="6" v3="7"/>
				<face v1="8" v2="9" v3="11"/>
				<face v1="9" v2="10" v3="11"/>
				<face v1="12" v2="13" v3="15"/>
				<face v1="13" v2="14" v3="15"/>
				<face v1="16" v2="17" v3="18"/>
				<face v1="16" v2="18" v3="19"/>
				<face v1="20" v2="21" v3="23"/>
				<face v1="21" v2="22" v3="23"/>
			</faces>
			<geometry vertexcount="24">
				<vertexbuffer positions="true" normals="true">
					<vertex>
						<position x="1.000000" y="-1.000000" z="-1.000000"/>
						<normal x="0.000000" y="-1.000000" z="0.000000"/>
					</vertex>
					<vertex>
						<position x="1.000000" y="-1.000000" z="1.000000"/>
						<normal x="0.000000" y="-1.000000" z="0.000000"/>
					</vertex>
					<vertex>
						<position x="-1.000000" y="-1.000000" z="1.000000"/>
						<normal x="0.000000" y="-1.000000" z="0.000000"/>
					</vertex>
					<vertex>
						<position x="-1.000000" y="-1.000000" z="-1.000000"/>
						<normal x="0.000000" y="-1.000000" z="0.000000"/>
					</vertex>
					<vertex>
						<position x="1.000000" y="1.000000" z="-0.999999"/>
						<normal x="0.000000" y="1.000000" z="0.000000"/>
					</vertex>
					<vertex>
						<position x="-1.000000" y="1.000000" z="-1.000000"/>
						<normal x="0.000000" y="1.000000" z="0.000000"/>
					</vertex>
					<vertex>
						<position x="-1.000000" y="1.000000" z="1.000000"/>
						<normal x="0.000000" y="1.000000" z="0.000000"/>
					</vertex>
					<vertex>
						<position x="0.999999" y="1.000000" z="1.000001"/>
						<normal x="0.000000" y="1.000000" z="0.000000"/>
					</vertex>
					<vertex>
						<position x="1.000000" y="-1.000000" z="-1.000000"/>
						<normal x="1.000000" y="-0.000000" z="0.000001"/>
					</vertex>
					<vertex>
						<position x="1.000000" y="1.000000" z="-0.999999"/>
						<normal x="1.000000" y="-0.000000" z="0.000001"/>
					</vertex>
					<vertex>
						<position x="0.999999" y="1.000000" z="1.000001"/>
						<normal x="1.000000" y="-0.000000" z="0.000001"/>
					</vertex>
					<vertex>
						<position x="1.000000" y="-1.000000" z="1.000000"/>
						<normal x="1.000000" y="-0.000000" z="0.000001"/>
					</vertex>
					<vertex>
						<position x="1.000000" y="-1.000000" z="1.000000"/>
						<normal x="-0.000000" y="-0.000000" z="1.000000"/>
					</vertex>
					<vertex>
						<position x="0.999999" y="1.000000" z="1.000001"/>
						<normal x="-0.000000" y="-0.000000" z="1.000000"/>
					</vertex>
					<vertex>
						<position x="-1.000000" y="1.000000" z="1.000000"/>
						<normal x="-0.000000" y="-0.000000" z="1.000000"/>
					</vertex>
					<vertex>
						<position x="-1.000000" y="-1.000000" z="1.000000"/>
						<normal x="-0.000000" y="-0.000000" z="1.000000"/>
					</vertex>
					<vertex>
						<position x="-1.000000" y="-1.000000" z="1.000000"/>
						<normal x="-1.000000" y="-0.000000" z="-0.000000"/>
					</vertex>
					<vertex>
						<position x="-1.000000" y="1.000000" z="1.000000"/>
						<normal x="-1.000000" y="-0.000000" z="-0.000000"/>
					</vertex>
					<vertex>
						<position x="-1.000000" y="1.000000" z="-1.000000"/>
						<normal x="-1.000000" y="-0.000000" z="-0.000000"/>
					</vertex>
					<vertex>
						<position x="-1.000000" y="-1.000000" z="-1.000000"/>
						<normal x="-1.000000" y="-0.000000" z="-0.000000"/>
					</vertex>
					<vertex>
						<position x="1.000000" y="1.000000" z="-0.999999"/>
						<normal x="0.000000" y="0.000000" z="-1.000000"/>
					</vertex>
					<vertex>
						<position x="1.000000" y="-1.000000" z="-1.000000"/>
						<normal x="0.000000" y="0.000000" z="-1.000000"/>
					</vertex>
					<vertex>
						<position x="-1.000000" y="-1.000000" z="-1.000000"/>
						<normal x="0.000000" y="0.000000" z="-1.000000"/>
					</vertex>
					<vertex>
						<position x="-1.000000" y="1.000000" z="-1.000000"/>
						<normal x="0.000000" y="0.000000" z="-1.000000"/>
					</vertex>
				</vertexbuffer>
			</geometry>
		</submesh>
	</submeshes>
</mesh>
Is there a different Ogre mesh.xml file structure or is there some trick you're using to selectively paste these verts into this structure? Sorry, I don't know how these are imported yet, so I'm not sure if just dumping the contents of <vertexbuffer> </vertexbuffer> will work, but I'm about to try.

-Q13

Re: .KRV extension in Wii Models?

Posted: Tue Oct 26, 2010 4:08 am
by FurryFan
I first use an empty ogre3d binary mesh (I got a mesh from a now defunct Spore Creature Model viewer converter but you can download a mesh shell with 1-4000 vertex tristrips (its tripled so it is doubled sided) from my website: http://ps23dformat.wikispaces.com/file/ ... odel1.mesh
The tristrip index is at offset 0x2D and could go up to offset 0x2F140
The vertexes data is stored as Vertex#1POS, Vertex#1NormalMapping, Vertex#1UVMap, Vertex#2POS....
The vertexes start at offset 0x2F195, and goes until offset 0xF1254

A sample file which is the same file above but with vertexes is http://ps23dformat.wikispaces.com/file/view/car.mesh
It is a Water Buffalo model that is completely one single tristrip, I think the UV coords are in it too, and maybe normal mapping. Otherwise you would delete the vertex at 0,0,0 and/or the vertex at the first position if you deliminate different tristrips by zeros in the face list or vertex list.

Re: .KRV extension in Wii Models?

Posted: Tue Oct 26, 2010 1:28 pm
by Quetzalcoatil
FurryFan,

Wow, thanks! That looks highly useful.
Got the pm, too. I'll try to digest this tonight and see what I can come up with.

-Q13

Re: .KRV extension in Wii Models?

Posted: Wed Oct 27, 2010 2:57 am
by Quetzalcoatil
Sooo...
You're right, that's a rather sheepish looking water buffalo, not a car. So I've finagled blender into importing .xml files and found the OGRE tools for the .mesh to .xml step. I tested with your car.mesh, FurryFan, and found the buffalo! Now looking at the car.mesh file I see the face index counting up from 1 to 0xff0f (LE I assume), but I'm having trouble locating a corresponding index list in the Her_ file from my game disk.

Code: Select all

9820C20820B9A92D2528E2080072EEF8
6228E21061E90DBEC120C20000CAF862
8A290210612D9E692D20E20800FBB6D8
B228E21061C12EF2C120C208002F9CD0
A32902186127BE73C91881102085A5C5
05102010200000000018A1102035A5E5
35102010200000000010201020000000
00102010200000000010201020000000
00102010200000000010201020000000
00102010200000000010201020000000
00102010200000000020A11020545456
5672E939
This is the first occurrence (out of 90) in this file, and the first couple of uint16s might make sense:49696, 8200, 43449. But this is a rather small file compared to others and its name is 'Her_Astri_Axe' so I'm thinking its an axe. (It might be the Astrid model with an axe, but why on earth would they do that?)
So I guess my question is if this sounds right: I take some of the tri-face indexes (the first half-ish from above) then copy the rest until I reach another '98' and plug it into the blankmodel1.mesh and try to get it into blender. Try to match vertex data with (number of faces in the index) times 32 bytes(vertex pos, norm, and uv data).

Thanks for all the help so far, its been a while since I had fun coding.
-Q13