Page 1 of 1
.aem (Android games)
Posted: Fri May 23, 2014 3:21 pm
by TomWin
I found in couple of android games, .aem extension
I upload model from Sport Cars Challenge
http://www.sendspace.com/file/1k1k9o
Re: .aem (Android games)
Posted: Fri May 23, 2014 9:49 pm
by Chipicao
I researched Sports Car Challenge a long time ago, but the format is stupid. Every triangle is separated from the mesh; there are no triangle strips, only single triangles. So the mesh ends up having lots of redundant vertices.
Whoever made this was either on drugs or didn't know what they were doing.
Plus the meshes aren't very good anyway, low details and lots of smoothing issues.
Code: Select all
aemFile = getOpenFileName "Open mesh" types:"aem mesh file (*.aem)|*.aem"
f = fopen aemFile "rb"
fseek f 24 #seek_set
numinds = readlong f #unsigned
farr = #()
for i=1 to numinds/3 do
(
i1 = readshort f #unsigned
i2 = readshort f #unsigned
i3 = readshort f #unsigned
append farr [i1, i2, i3]
)
varr = #()
for i=1 to numinds do
(
vx = readfloat f
vy = readfloat f
vz = readfloat f
append varr [vx, -vz, vy]
)
tarr = #()
for i=1 to numinds do
(
tx = readfloat f
ty = readfloat f
append tarr [tx, ty, 0]
)
narr = #()
for i=1 to numinds do
(
nx = readfloat f
ny = readfloat f
nz = readfloat f
append narr [nx, -nz, ny]
)
carr = #()
for i=1 to numinds do
(
r = readfloat f
g = readfloat f
b = readfloat f
a = readfloat f
append carr [r * 255, g * 255, b * 255, a * 255]
)
fclose f
max modify mode
cui.expertModeOn()
with redraw off
(
amesh = mesh vertices:varr faces:farr
meshop.setMapSupport amesh 0 true
for i = 1 to numinds do setVertColor amesh i carr[i]
meshop.setMapSupport amesh 1 true
setMesh amesh tverts:tarr
for face = 1 to amesh.numfaces do setFaceSmoothGroup amesh face 1
select amesh
addmodifier amesh (Edit_Normals ()) ui:off
amesh.Edit_Normals.MakeExplicit selection:#{1..nArr.count}
EN_convertVS = amesh.Edit_Normals.ConvertVertexSelection
EN_setNormal = amesh.Edit_Normals.SetNormal
normID = #{}
--apply normals
for v = 1 to nArr.count do
(
free normID
EN_convertVS #{v} &normID
for id in normID do EN_setNormal id nArr[v]
)
collapseStack amesh
max select none
)
cui.expertModeOff()
Re: .aem (Android games)
Posted: Sat May 24, 2014 2:07 am
by huckleberrypie
Asphalt 8 and Real Racing 3 had way better models than this lol.