Path: chuka.playstation.co.uk!scea!peter_alau@playstation.sony.com From: jamin1@psu.edu (Jamin Frederick) Newsgroups: scee.yaroze.programming.3d_graphics Subject: Re: creation of tmds Date: Thu, 02 Jul 1998 03:57:47 GMT Organization: SCEA News Server Lines: 90 Message-ID: <359b0284.176613649@news.scea.sony.com> References: <354f8520.24963808@www.netyaroze-europe.com> <35527A2E.72F907B4@home.com> <6n904u$4sn1@scea> <359965bc.370444681@news.scea.sony.com> NNTP-Posting-Host: 98M0022.dorm.gmu.edu X-Newsreader: Forte Free Agent 1.11/32.235 On 01 Jul 1998 12:18:16 +1000, Toby Hutton wrote: >> >> So if I have a model about 2000.0 wide, will that easily "blink out" >> when I get too far away from it, assuming it doesn't get too small to >> see? > >Yeah, probably. But if you go and make your models all 16000 wide >then you'll have real trouble. > >> > >> >That's a reason why you shouldn't make your models too big (I saw this >> >was a question in your FAQ). >> >> Yea, thanks for the answer. I'm not sure if what I posted about being >> too small is correct, though. Is it true that a model will distort, >> or shrink, if it is rotated all the time? > >Quite possibly, yes. Well, you shouldn't be compounding rotations of >an object anyway (1st rule in 3D transformations). If something is >spinning in space you should maintain a rotation value for each axis >and increment or decrement that - then apply it to the object. You >shouldn't rotate an object a small amount, then rotate the new object >some more next frame, etc. That's when you compound your round-offs >and get distortion. But it's hard to do it the wrong way on the >Yaroze as the libraries are designed to be used the right way. If you >were making your own runtime TMDs you may be able to do it the wrong >way though, I suppose... > so is this the "wrong way", as I have in my FAQ?: 10) How do I rotate an object? First you have to know that all models rotate about the origin (0,0,0) of your model's coordinate system (do rsdform -v mymodel.rsd). This means that however your primitives are placed in your RSD, they will rotate around this point. So if the "center" of your model (representing the actual center of your model) is not (0,0,0), translate it there first before you rotate it. Assuming there is an initialized GsCOORDINATE2 Coord structure (belonging the object which I am rotating), and I want to rotate the object (RotX, RotY, RotZ): MATRIX TempMatrix; SVECTOR RotVector; // this makes a vector RotVector.vx = RotX; RotVector.vy = RotY; RotVector.vz = RotZ; // this turns a vector into a matrix, so that I can multiply RotMatrix(&RotVector, &TempMatrix); // multiply original coord matrix by "rotation" matrix MulMatrix0(&Coord.coord, &TempMatrix, &Coord.coord); // object should be redrawn now since it changed Coord.flg = 0; Note: Rotation this way may distort your model if your model is not very large. This code just adjusts the model a little each frame, not keeping track of a rotation vector like you said. However, I haven't really noticed any distortiion in my model, that's why I thought it had to do with the size of it. I haven't figured out how to keep track of a rotation vector yet, since it seems like it gets screwed up once the model gets oriented in an arbitrary direction. >Also, if you have really small models, like only 5 or 10 units across, >then to see them the view point is going to have to be really close >and then you get weird skewwy effects, slow down, textures all >crappy... >-- >Toby.