$PSDocId: Document Release 1.0 for Runtime Library Release 3.6$ TMDVIEW4 TMDVIEWER using GsDOBJ2 1994.12.9 CopyRight (C) Sony Computer Entertainment tuto0: simple tmdviewer using GsDOBJ2(GsSortObject4()) [how to run] psymake tuto0 compile psymake load load data [key assign] left direction buttons transfer XY right direction buttons rotation R1/R2 buttons transfer Z [modeling data] There are 16 modeling data. The type of modeling data is categolized by extension of the file name. g : gour shading model t : transparent model l : preshaded model The shape of modeling data is cube, three surface are non textured and remaining three surfaces are 2/8/15 bit texture mapped. You can see all modeling data by this program,loading each data. cube3.tmd flat polygon cube3g.tmd gour polygon cube3gl.tmd gour preshaded polygon cube3gt.tmd gour transparent polygon cube3gtl.tmd gour preshaded transparent polygon cube3l.tmd flat preshaded polygon cube3t.tmd flat transparent polygon cube3tl.tmd flat preshaded transparent polygon cube4.tmd flat quad polygon cube4g.tmd gour quad polygon cube4gl.tmd gour preshaded quad polygon cube4gt.tmd gour transparent quad polygon cube4gtl.tmd gour preshaded transparent quad polygon cube4l.tmd flat preshaded quad polygon cube4t.tmd flat transparent quad polygon cube4tl.tmd flat preshaded quad transparent polygon and sample modeling data shuttle1.tmd [texture data] pat4.tim 4bit clut texture data pat8.tim 8bit clut texture data pat16.tim 16bit direct texture data pat4t.tim 4bit clut transparent texture data pat8t.tim 8bit clut transparent texture data pat16t.tim 16bit direct transparent texture data [explanation] GsDOBJ2 & GsSortObject4() is most nomal polygon routine. Packet memory is minimum because of clipped polygons are omitted. It is possible for copying objects easily, copying say same modeling data but diffrent model. GsSortObject4() is the polygon routine for GsDOBJ2. Automatic polygon subdivision means all polygons in it's object are divided fix rate set by attribute of the handler. tuto1: using GsSortObject4J() [how to run] psymake tuto1 compile & run [key assign] same as tuto0 [modeling data] ONLY cube3.tmd [comments] This program is substitute GsSortObject4 for GsSortObject4J. This program reduces code size because of linking only minimum funcion set to decode limited polygon types. The differences tuto0 and tuto1 are following. 1 In init_all() calling jt_init() 2 Substitute GsSortObject4 for GsSortObject4J In jt_init(),only GsTMDfastF3L,GsTMDfastTF3L reserved,so this program can views the model constracted only nomal lighting flat polygons. It is not possible that subdivision and fogging and preshading. Tuto1's code size is 48Kbyte less than tuto0. If you need more function , you register subroutines for your need to the jump table. If you register all subroutines to the jump table, GsSortObject4J() is compatible to GsSortObject() there is the skeleton of the jump table in libgs.h (jt_init4()) The way to find which functions are in use to display certain modeling data is to register dmy function named "dmy" extension. ex. dmyGsTMDfastF3L,dmyGsTMDfastTF3L These subroutines prints it's name. tuto2: active sub divide sample [how to run] psymake tuto2 compile psymake load load [key assign] same as tuto0 [comments] This program divide polygons according width ,height and z value. If you want this function , you register active subdivide sub routines (ex. GsA4div...()) to the jump table. In order to reduce code size , you must not register not necessary sub routines. The conditions of divide is set by GsSetAzwh(z,w,h). Z means start near Z point to do active sub divide. Farer than this point , polygons are not divided. W and h limits polygon size, after divided polygon's width and height are larger than this value,divide routine are called recursivly. But the number of recursive calling is limitted NDIV in the attribute. tuto3: sample code for split screen using GsDOBJ5 [how to run] make tuto3 compile & load files [key assign] same as tuto0 [modeling data] same as tuto0 [comments] This program split screen upper and lower part. The viewpoint of each screen is different. The modeling data is common with upper and lower screen, but object hadlers are different. GPU drawing command is quing by libgpu so tehre is no wainting sequence in this program. tuto4: sample code for multi ot and using same object with different hadlers. [how to run] make tuto4 compile & load files [key assign] right direction key rotate object0 right upper key zoom in / out object0 left direction key rotate object1 left upper key zoom in / out object1 [modeling data] same as tuto0 [comments] This program is sample code for same object with diffrent handlers, and sorting multi OTs. "point" of Wot2 which is set by GsClearOt(offset,point,Wot2) is the reference point of Wot1. So GsSortOt(&Wot2,&Wot1) sorts Wot2 to Wot1 by the "point" value of Wot2. Because "point" value is 0 in the sample code, object2 sorted to Wot2 is always front of the object sorted Wot1. If you set the point value 1<