|
Wasn't sure if this is the right section as this is more informative than tutorial-like.
Animation Skins:
Let's start with TSKINS, VSKINS1, and PRI:. Let's start with the easiest of the three, PRI:. PRI: stands for priorities. This is how the client knows what to show over another object. This is why sometimes items will glitch in RuneScape because either the priorities are wrong, or it is nearly impossible to get the priorities to match with every single item. Sometimes a cape will show over a plate body, or plate legs on top of a plate body. The higher the value the more it will show over top of. Like the chest piece of a armor is PRI: 3, and the platelegs are PRI:2.
Next we will do VSKINS. VSKINS is how you group each vertice in a model. If a vertex requires a numerical value of more than 100, e.g., gloves, you must make two separate objects. One labeled VSKINS1: and the other labeled VSKINS2:. Say you wanted the vertex to be grouped as 180. You would set that vertex's value to be 100 on VSKINS1: and 80 on VSKINS2:. Then DatMaker would combine the values and read it as 180 when converting to a .dat file extension. If you have ever played on a RSPS where when you walk your item glitches all up, this is because the VSKINS aren't correct. Basically they allow animation to be set to the model.
Next we have TSKINS. TSKINS are used for changing alpha values.
You can think of it this way. You have a bone O-----O. At the end are two O's. These stand for your VSKINS. The ------- stands for your priorities. And the TSKIN would go around the bone. Now let's say that the O on the left's value is 6 and the O on the right is 7. That bone cannot bend because there isn't a weight in between it. O--O----O. This bone could move. The order of the weights would go 6, 7, 8, from left to right. Generally as you get closer to the edge of a model, the VSKIN values increase.
Rendering System:
The max number of triangles with a priority value (excluding flags) that will be rendered in an unaltered client is 2000. If the model exceeds 2000 triangles with priority animation data, then the model will be returned as a null and will appear invisible.
The max number of triangles, period, rendered in an unaltered client is 4096. That means if a model contains 4097 triangles, it will be returned as a null and appear invisible.
That max model extents, meaning the maximum x,y,z value is +/-1024... sqrt(1024²*1024²) = 1448.1546 (RuneScape uses 1500 just to make sure).
When rendering a model, the client uses fixed point arithmatic (Fixed Point Arithmetic) which basically means any vertices less than 4 units in distance will end up at the same point on the screen. That is why if you ever try loading a high polygon-count model into the RuneScape client, the rendering will be shit.
Animations (::emote):
An unedited client can't load animation files with data chunks greater than 2^16 bytes long, neither can RSPoser (program by MrPotatoHead to make animations for a 317 client). RSPoser can, but then it crashes. The 474 and 508 animation files hold data in different locations; the frame duration in the 317 is in the file, in the 474, it's in seq.dat. Same with frame IDs.
Some notes and help from MrPotatoHead:
Originally Posted by MrPotatoHead
Texture support in DatMaker written in Delphi by MrPotatoHead:Originally Posted by MrPotatoHead
Code:unit trig; interface uses Windows, OpenGL,SysUtils, FileRSM, OpenGl1x, Math; type Tex3Vx2UV = array[0..2] of TVector2d; function SinRule(lenb,angA,angB : Double) : Double; function len3D(x1,y1,z1,x2,y2,z2 : Integer) : Double; function CosRule(len1,len2,len3 : Double) : Double; procedure DoStuff; var UV: array of Tex3Vx2UV; implementation // procedure to calculate all of the UV coordinates in the model file // Call after loading the model and before displaying procedure DoStuff; var ti,i,k,testflag,s0,su,sv : Integer; lenau,lenaq,lenuq,lenus,lenav,lenvq,lentv : Double; Angle_U,Angle_V,U_number,V_number,Angle_A,Angle_B : Double; Error_Angle : Double; begin SetLength(UV, 0); SetLength(UV, GNumTriangles); // for each triangle in model for i := 0 to high(F) do begin testflag := 0; //for each point in model triangle. for k := 0 to 2 do begin if M[i] >1 then begin //E1 ti := ( (M[i] + 2) div 4) -1; lenau := len3D(V[Tex[ti][0]][0], V[Tex[ti][0]][1], V[Tex[ti][0]][2], V[Tex[ti][2]][0], V[Tex[ti][2]][1], V[Tex[ti][2]][2]) ; lenaq := len3D(V[Tex[ti][0]][0], V[Tex[ti][0]][1], V[Tex[ti][0]][2], V[F[i][k]][0], V[F[i][k]][1], V[F[i][k]][2]) ; lenuq := len3D(V[Tex[ti][2]][0], V[Tex[ti][2]][1], V[Tex[ti][2]][2], V[F[i][k]][0], V[F[i][k]][1], V[F[i][k]][2]) ; lenav := len3D(V[Tex[ti][0]][0], V[Tex[ti][0]][1], V[Tex[ti][0]][2], V[Tex[ti][1]][0], V[Tex[ti][1]][1], V[Tex[ti][1]][2]) ; lenvq := len3D(V[Tex[ti][1]][0], V[Tex[ti][1]][1], V[Tex[ti][1]][2], V[F[i][k]][0], V[F[i][k]][1], V[F[i][k]][2]) ; Error_angle := 0; //get angle A and B for error correction. If (lenaq <> 0) AND (lenau <> 0) AND (lenav <> 0) AND (lenaq <> 0) then begin Angle_A := CosRule(lenaq,lenau,lenuq) ; Angle_B := CosRule(lenav,lenaq,lenvq) ; Error_angle := (Angle_A + Angle_B) - 90; end; //calculate U number if (lenau = lenaq ) AND (lenuq = 0) then U_number := 1.0 else if (lenaq = 0) OR (lenau-lenaq = 0 ) then U_number := 0.0 else begin Angle_U := CosRule(lenau,lenuq,lenaq) ; lenus := SinRule(lenuq,(90-Angle_U - Error_Angle),90) ; If lenau <> 0 then U_number := (lenau - lenus) * (1 / lenau) else MessageBox(0, PChar('division by Zero'), PChar('NaN'), MB_OK); end; //calculate V_number if (lenav =lenaq) AND (lenvq = 0) then V_number := 1.0 else if (lenaq = 0) OR (lenav-lenaq = 0) then V_number := 0.0 else begin Angle_V := CosRule(lenvq,lenav,lenaq); lentv := SinRule(lenvq, (90 - Angle_V - Error_Angle), 90); If lenav <> 0 then V_number := (lenav - lentv) * (1 / lenav) else MessageBox(0, PChar('division by Zero'), PChar('NaN'), MB_OK); end; UV[i][k][0] := V_number; UV[i][k][1] := 1-U_number; end else //end E1 begin //for when no texture is used UV[i][k][0] := 0; UV[i][k][1] := 0; end ; end; //end of k loop end; //end of i loop end; //end of procedure function len3D(x1,y1,z1,x2,y2,z2 : Integer) : Double; begin Result := Sqrt( ((x1-x2)*(x1-x2))+ ((y1-y2)*(y1-y2))+ ((z1-z2)*(z1-z2)) ); end; function CosRule(len1,len2,len3 : Double) : Double; var temp1, radtemp : Double; // len1 = a, len2 = b, len3 = c begin If (len1 <= 0) OR (len2 <= 0) then MessageBox(0, PChar('division by Zero'), PChar('NaN'), MB_OK); temp1 := ((len1*len1)+(len2*len2)-(len3*len3))/(2*len1*len2); if (temp1 < 1.0) AND (temp1 > -1.0) then begin //if (temp1 < 1.0) then begin radtemp := ArcCos(temp1); Result := RadToDeg(ArcCos(temp1)); end else if (temp1 >= 1.0) then Result := 0 else if (temp1 <= -1.0) then result := 180; //Result := ArcCos(temp1); end; function SinRule(lenb,angA,angB: Double) : Double; var temp1, radtemp : Double; begin // a / Sin(A) = b / Sin(B) // therefore a = (b * Sin(A))/ Sin(B) if (Sin(DegToRad(angB))) <= 0 then MessageBox(0, PChar('division by Zero in sin'), PChar('NaN'), MB_OK); Result := (lenb * Sin(DegToRad(angA)) ) / (Sin(DegToRad(angB))); end; end.
thank you i think this is in the wrong section though.
I think informative threads is a better location for this, thanks for the info though.
Thanks, I think this is more of an informative thread :L
I like how you explained by using O-----O
finally, i understand the animating sht. thx
I did not see the informative section. Guess I must be blind. A mod is free to move this anywhere.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |