Gah - a solution with more questions. – EntropicLqd
Difference between revisions of "Legacy:T3D File"
(→Loading T3D brush geometry) |
(→Loading T3D brush geometry) |
||
Line 147: | Line 147: | ||
[[Image:texinfot3d.jpg]] <br> | [[Image:texinfot3d.jpg]] <br> | ||
− | Texture Scaling | + | Texture Scaling information is given from TexU and TexV values. |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
Python T3D loader (doesn't care about texture informations): http://carolina.mff.cuni.cz/~gib/ut_utils/unreal_t3d_loader.zip see readme.txt in zip file | Python T3D loader (doesn't care about texture informations): http://carolina.mff.cuni.cz/~gib/ut_utils/unreal_t3d_loader.zip see readme.txt in zip file | ||
Revision as of 06:45, 15 January 2009
The T3D file format or Unreal Text File holds a text list of Unreal map objects. An entire map can be saved as this file format, or just a single actor or brush.
Note that while brushes, their applied textures and light actors are saved, the Unreal Geometry itself is not saved: upon importing a T3D file the map must be built.
Copying objects from UnrealEd and pasting into a text editor produces the same format.
Unreal Text format
Exported brushes and (other) actors. See T3D file.
- Created by:
- UnrealEd's File -> Import command
- UnrealEd's Brush -> Import command (see Data Import and Export for more on both these commands).
- is this created by external stuff too?
Contents
Exporting T3D
- Export the whole map: File -> Export...
- export one brush:
- export a part of a map: either save, delete discards and export as above, or select, copy, paste into a text editor and save as a T3D file
Importing T3D
File -> Import...
(note importing may take a LONG time)
Overheard on #utjb... :-)
<tarquin> t3d stores brushes & actors but not texturing, right? <Mychaeel> Texturing as well. (melds into the opening speech from Reservoir Dogs...) <DaveA>Stores links to textures, and texture transforms, but not the pixels themselves
The T3D format is a text file which stores information about map actors. It's in fact identical to what can be copied from UnrealEd to a text editor. An exported map looks like this:
Begin Map Begin Actor Class=LevelInfo Name=LevelInfo0 TimeSeconds=17.008888 Summary=LevelSummary'Entry.LevelSummary' DefaultGameType=Class'Botpack.UTIntro' AIProfile(0)=23784352 AIProfile(1)=52 AIProfile(2)=41 AIProfile(3)=42 AIProfile(4)=40 AIProfile(5)=44 AIProfile(6)=45 AIProfile(7)=21846171 AvgAITime=0.000000 Level=LevelInfo'Entry.LevelInfo0' Tag=LevelInfo Region=(Zone=LevelInfo'Entry.LevelInfo0',iLeaf=-1) Name=LevelInfo0 End Actor Begin Actor Class=Brush Name=Brush0 MainScale=(SheerAxis=SHEER_ZX) PostScale=(Scale=(X=0.250000,Y=8.000000,Z=3.000000),SheerAxis=SHEER_ZX) TempScale=(Scale=(X=0.250000,Y=8.000000,Z=3.000000),SheerAxis=SHEER_ZX) Level=LevelInfo'Entry.LevelInfo0' Tag=Brush Region=(Zone=ZoneInfo'Entry.ZoneInfo0',iLeaf=1,ZoneNumber=1) Location=(X=464.000000,Y=-16.000000,Z=64.000000) Begin Brush Name=Brush Begin PolyList Begin Polygon Item=OUTSIDE Texture=black1 Flags=4194304 Link=0 Origin -00160.000000,+00000.000000,+00128.000000 Normal +00000.000000,+00000.000000,+00001.000000 TextureU +00004.000000,+00000.000000,+00000.000000 TextureV +00000.000000,+00004.000000,+00000.000000 Vertex -00128.000000,-00128.000000,+00128.000000 Vertex +00128.000000,-00128.000000,+00128.000000 Vertex +00128.000000,+00128.000000,+00128.000000 Vertex -00128.000000,+00128.000000,+00128.000000 End Polygon ... End PolyList End Brush Brush=Model'Entry.Brush' Name=Brush0 End Actor Begin Actor Class=PlayerStart Name=PlayerStart0 Level=LevelInfo'Entry.LevelInfo0' Tag=PlayerStart Region=(Zone=ZoneInfo'Entry.ZoneInfo0',iLeaf=1,ZoneNumber=1) Location=(X=183.134430,Y=-987.334167,Z=33.978027) OldLocation=(X=-217.561523,Y=-44.538128,Z=-87.899948) Name=PlayerStart0 End Actor ... End Map
External link: http://unreal.jall.org/tutorials/t3d.html (new URL)
Loading T3D brush geometry
You must parse those informations correctly: PrePivot, Location, Rotation, MainScale, PostScale, TempScale, Polygon / Vertexes
FOR each vertex of each polygon of parsed brush DO: do MainScale ... x *= MainScale[x], y *= MainScale[y], z *= MainScale[z] do translation (-PrePivot[x], -PrePivot[y], -PrePivot[z]) do rotation Yaw, Pitch, Roll do PostScale ... x *= PostScale[x], y *= PostScale[y], z *= PostScale[z] do TempScale ... x *= TempScale[x], y *= TempScale[y], z *= TempScale[z] do translation (Location[x], Location[y], Location[z]) ENDFOR
Note: For Unreal Engine 3.x based maps (Unreal Tournament 2004 and 2003),PostScale,MainScale,TempScale and Rotation values are always null as the editor automatically updates vertices,origin and normal values when scaling up/down or rotating a brush.
Rotation matrix are the following:
Roll Matrix-X Axis: 1, 0, 0, 0, 0, cos(roll),-sin(roll), 0, 0, sin(roll),cos(roll), 0, 0, 0, 0, 1
Pitch Matrix-Y Axis: cos(pitch), 0, sin(pitch), 0, 0, 1, 0, 0, -sin(pitch), 0,cos(pitch), 0, 0, 0, 0, 1)
Yaw Matrix-Z Axis: cos(yaw), sin(yaw), 0, 0, -sin(yaw), cos(yaw), 0, 0, 0, 0, 1, 0, 0, 0, 0, 1
Global Rotation Matrix=(Roll Matrix)*(Pitch Matrix)*(Yaw Matrix)
Yaw, Roll and Pitch values are in radians. Original values from t3d files are in "Unreal format" where 2 rad = 65536. For more information about Yaw, Pitch, Roll rotation matrix see http://mathworld.wolfram.com/EulerAngles.html.
Unknown (correct) effect: SheerAxis
Texturing information:
Texture U and Texture V: contains information about scaling and texture rotation
PanU and PanV: only used in Unreal Tournament
Origin: where the texture is centered
Normal: normally, the perpendicular vector of the surface where the texture is applied.
TextureU, TextureV, PanU, PanV, Origin and Normal are informations about how to apply texture for the polygon.
Texture Scaling information is given from TexU and TexV values. Python T3D loader (doesn't care about texture informations): http://carolina.mff.cuni.cz/~gib/ut_utils/unreal_t3d_loader.zip see readme.txt in zip file
Scaling up/down whole map
This operation is mainly needed when you want to port Unreal 1 or Unreal Tournament map to Unreal Tournament 2004 or Unreal Tournament 3.
To do so,considering ScaleFactor:
For each actor in T3D File set Location = ScaleFactor*Location set PrePivot = ScaleFactor*PrePivot If Actor==Brush For each polygon set Origin = ScaleFactor*Origin For each vertex set Vertex = ScaleFactor*Vertex If Actor==StaticMesh set DrawScale3D = ScaleFactor*DrawScale3D
Usually scale factor values: Unreal 1/Unreal Tournament to UT2003/UT2004/UT3: 1.25
T3D Utilities
- MapScale scales an entire .t3d file
- MeshMaker converts a prefab in .t3d format to a decoration
- UnrealROC converters: from 3DMF, to VRML/X3D/OBJ (including textures et al).
Related Topics
Kefik: There can be also a tag 'CsgOper' which have one of two values ... 'CSG_Subtract' -> subtract the brush from space or 'CSG_Add' -> add this brush to shape.
Sobiwan: New to WIKI editing, but not using it. I was searching for the actual format of T3D and found Mongo's description of Planetunreal to be extremely helpful. I'll ask him (mongo@planetunreal.com) if we can use and/or edit his description here. The format is much more involved than described here. We can even supply examples of how to do particular hacks.
MadNad: Interestingly, I was able to convert a Quake3_Level into a unreal map. Quite interesting. First i converted a *.bsp to a *.map in quake, then I made a level that was just a huge cube and converted it to *.t3d. With an external app (i'll have to find the name of it ) I was able to merge these two together. After some scaling and switching additive brushes in quake to subtractive brushes in ued and subtractive to additive, I compiled and had q3dm7 geometry. I don't necessarily recommend doing this, as it will take more time to fix than create it from scratch, but I thought I would share a little experience I had with this.