Path: chuka.playstation.co.uk!scea!peter_alau@playstation.sony.com From: Charles Nicholson Newsgroups: scee.yaroze.programming.3d_graphics,scea.yaroze.programming.3d_graphics Subject: Joy of TMD's. (Be warned, long source code included) Date: Fri, 08 Jan 1999 15:43:07 -0500 Organization: SCEA News Server Lines: 94 Message-ID: <36966DDB.12400BA5@vassar.edu> NNTP-Posting-Host: toshiba-173-23.nycap.rr.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.07 [en] (Win95; U) Xref: chuka.playstation.co.uk scee.yaroze.programming.3d_graphics:1124 scea.yaroze.programming.3d_graphics:330 Hello to all again... I'm slowly figuring stuff out, but i'm afraid i've hit something of a wall. I'm trying to display a simple cube .tmd file, and the yaroze keeps hanging on me. I've reduced the program to what i think are the bare essentials, and it absolutely refuses to work for me. If anyone wouldn't mind looking over the source, i would REALLY appreciate any advice/comments/etc... thanks a lot- charles ........................................ TEST.C .......................................... #define TMD_FILE (u_long *) 0x80120000 GsDOBJ2 object; GsCOORDINATE2 coord; VECTOR pos; GsRVIEW2 view; u_long *tmd = TMD_FILE; void InitTMD(void) { tmd++; GsMapModelingData(tmd); tmd += 2; GsLinkObject4((u_long)tmd,&object,1 << 10); GsInitCoordinate2(WORLD,&coord); } void InitView(void) { view.vrx = view.vry = view.vrz = 0; view.vpx = view.vpy = 0; view.vpz = -100; view.rz = 0; view.super = WORLD; } void DrawTMD(int db) { MATRIX tmp; GsGetLs(&coord,&tmp); GsSetLsMatrix(&tmp); GsSortObject4(&object,&WOT[db],4,getScratchAddr(0)); } void main(void) { int draw_buf; SetVideoMode(MODE_NTSC); GsInitGraph(320,240,4,0,0); GsDefDispBuff(0,0,0,240); GsInit3D(); InitView(); GsSetAmbient(ONE / 2,ONE / 2,ONE / 2); InitTMD(); GetPadBuf(&bb0,&bb1); WOT[0].length = WOT[1].length = 10; WOT[0].org = WOT_tag[0]; WOT[1].org = WOT_tag[1]; coord.coord.m[0][0] = 1; coord.coord.m[1][1] = 1; coord.coord.m[2][2] = 1; while (!done) { draw_buf = GsGetActiveBuff(); GsSetWorkBase((PACKET *) GPUPacket[draw_buf]); GsClearOt(0,0,&WOT[draw_buf]); DrawTMD(draw_buf); DrawSync(0); VSync(0); GsSwapDispBuff(); GsSortClear(0,0,0,&WOT[draw_buf]); GsDrawOt(&WOT[draw_buf]); } }