Model Rendering In Menus... -1 reply

Please wait...

JaedenRuiner

Crazy Coding SP Guy...

50 XP

27th December 2002

0 Uploads

168 Posts

0 Threads

#1 10 years ago

Alright,

I'm going to ask because I just don't get it, maybe my math isn't what it used to be and granted I am probably the least likely to ever work on 3D modeling and other such visually artistic endeavors ('tis why I'm a coder) I can quite understand how the model codes are used to render.

Codes of Importance(In Menus and Translated to the rendering Engine): [Menu Files] rect = Rect of Window to place object model_g2mins # # # = ??? model_g3mins # # # = ??? (Don't know if these are x y z, x z y, z y x, z x y, y z x, or y x z) model_fovy # = Field-of-view or "zoom" bigger = further away model_fovy # = Field-of-view or "zoom" bigger = further away In the source files these values are parsed into ItemDef structures (i forget the exact fields but you can find them easily by search-in-files for model_g2maxs, etc) and as well are later used in Item_Model_Paint() to initialize the calculated fields in refdef_t structure used for rendering.

Now the big thing to me is i get a REct for the screen i need to know how the other values affect where it will be located. For example in the saber.menu file: itemDef { name saber group models type ITEM_TYPE_MODEL //rect 12 -80 615 615 rect 10 240 470 420 asset_model "models/weapons2/saber_reborn/saber_w.glm" isSaber 1 model_angle 180 model_rotation 20 model_g2mins 0 0 0 model_g2maxs 20 20 20 //model_fovx 75 //model_fovy 75 model_fovx 90 model_fovy 90 visible 1 decoration }

Now that rect (10 240 470 420) is the measured dimensions of the rect within the image (i exported the JPG and resized it to 640x480 for reference). However when the menu comes up in game the model is off the screen to the bottom. (one of my transitions moves the box upwards slightly and i can see the sabers are being drawn below the screen).

Why?

if my rect dimension are set as they are, how does the fovx, fovy, g2mins and g2maxs affect the drawing so drastically as to completely ignore my original rectangle ( or go so far beyond it the item no longer renders on screen).

Thank Jaeden "Sifo Dyas" al'Raec Ruiner




The One and Only

I R Scary Eyeball

50 XP

29th January 2004

0 Uploads

4,091 Posts

0 Threads

#2 10 years ago

It may be that your model is being positioned relative to the background image, it does weird things like that sometimes.




redsaurus

Uses a Mac

50 XP

3rd February 2004

0 Uploads

126 Posts

0 Threads

#3 10 years ago

You've got it being 480*640, not 640*480.

rect 10 240 470 420

should be

rect 240 10 420 470