
08-Feb-2006 22:23
So BAH Strike was talking to me yesterday about the math behind transforming a 3D world X Y Z position to 2D screen X Y positions.
It made me think of Zeq's direct draw research where he was able to draw rectangles and print text to screen.
If Zeq's research could be used along with the JK.dll extended cog features, we could make a FULLY customizible HUD that would be capible of FAR more than what the standard HUD.
If we were able to use a cog function that allows us to create HUD "objects", such as:
dummy = CreateHudSlate(Xpos,Ypos,width,height,bgColor,bgMat,txtColor);
Then we could use other new cog verbs to modify it, such as:
WriteToHud(dummy,"Objective Complete!");
JK Patcher could grab the string that is sent as the param and print it to the rectangle that already exists for the HUD object "dummy".
Now, this relates to my conversation with BAH Strike how? Well, if we could change world X Y Z coords into screen X Y, we can place menus and/or alerts over specific objects. For starters, it could just be a verb that converts X Y Z to screen X Y, like:
screenCords = WorldToScreen('X Y Z',player);
So, for example, to make a player's name appear over him when you look directly at him, you could just translate the player's XYZ into screen XY, and create your HUD slate there and have it print the player's name on the slate.
Obviously there are functional details that need to be handled with the new cog verbs and what params they will require. I'm just trying to keep it very basic to be sure I get my idea accross.
Now, printing static text strings to these HUD slates isn't all you can do. For example, using some form of JK Mouse, you could have web-enabled Message of the Days, neatly display player stats, have team selection menus instead of CTF lobbies, anything you can think of. All without the hasle of trying to use 3do's as HUD objects. GoldenEye 007 style radar would be as simple as pie. All you would have to do is have a ghost above the player looking stright down, and use WorldToScreen() using the position of enemies as the first param's coords, and the ghost way above looking down as the perspective. Then scale this down and throw it into the top right of the HUD.
RPG's could make EXTENSIVE use of this system too. Using some form of JK Mouse, JK gameplay could be altered to match that of KotoR almost exactly. Item-specific menus could be generated above objects. Dialogue could be displayed in cut-scene style or comic cloud style with ease.