Home My Page Projects Code Snippets Project Openings 3D graphics for Standard ML
Summary Activity SCM

SCM Repository

[sml3d] Diff of /trunk/sml3d/examples/md3-viewer/load-md3.sml
ViewVC logotype

Diff of /trunk/sml3d/examples/md3-viewer/load-md3.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 389, Tue Jan 13 16:23:31 2009 UTC revision 391, Tue Jan 13 23:01:40 2009 UTC
# Line 109  Line 109 
109            end            end
110    
111  (*+DEBUG*)  (*+DEBUG*)
112  val v2s = SML3dTypeUtil.fmt3 Float.toString  val t2s = SML3dTypeUtil.fmt3 Float.toString
113    val v2s = SML3dTypeUtil.fmtv3 Float.toString
114  (*-DEBUG*)  (*-DEBUG*)
115    
116    (* read the MD3 header *)    (* read the MD3 header *)
# Line 152  Line 153 
153          "frame: name = \"", name, "\"; bbox = (", v2s minBounds, ", ", v2s maxBounds, ")\n",          "frame: name = \"", name, "\"; bbox = (", v2s minBounds, ", ", v2s maxBounds, ")\n",
154          "       origin = ", v2s localOrigin, "\n"          "       origin = ", v2s localOrigin, "\n"
155        ])        ])
156            in FRAME{            in MD3.FRAME{
157              name = name,              name = name,
158              minBounds = minBounds,              minBounds = minBounds,
159              maxBounds = maxBounds,              maxBounds = maxBounds,
# Line 317  Line 318 
318                              in                              in
319  (**)  (**)
320  print(concat["V[", StringCvt.padLeft #" " 3 (Int.toString i), "] v = ",  print(concat["V[", StringCvt.padLeft #" " 3 (Int.toString i), "] v = ",
321  v2s v, ", n = ", v2s n, "\n"]);  t2s v, ", n = ", t2s n, "\n"]);
322  (**)  (**)
323                                DB.set3f (vBuf, i, v);                                DB.set3f (vBuf, i, v);
324                                DB.set3f (vBuf, i, n)                                DB.set3f (vBuf, i, n)
# Line 327  Line 328 
328                          MD3.MESH{verts = vBuf, norms = nBuf}                          MD3.MESH{verts = vBuf, norms = nBuf}
329                        end                        end
330                  in                  in
331                    repeati readFrame numFrames                    List.tabulate (numFrames, readFrame)
332                  end                  end
333            val () = seek (inS, start + endOffset)            val () = seek (inS, start + endOffset)
334            in            in
# Line 354  Line 355 
355            val () = seek (inS, tagsOffset)            val () = seek (inS, tagsOffset)
356            val tags = readN readTag (inS, numTags)            val tags = readN readTag (inS, numTags)
357            val () = seek (inS, surfsOffset)            val () = seek (inS, surfsOffset)
358            val surfs = readN (readSurface frames) (inS, numSurfaces)            val surfs = readN readSurface (inS, numSurfaces)
359            in            in
360              MD3.MODEL{              MD3.MODEL{
361                  tags = tags,                  tags = tags,

Legend:
Removed from v.389  
changed lines
  Added in v.391

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0