Weapon Models

Discuss the creation of various model formats for Quake engines, and related matters to modeling.
Post Reply
ajay
Posts: 559
Joined: Fri Oct 29, 2004 6:44 am
Location: Swindon, UK

Weapon Models

Post by ajay »

Is there anything special a model needs to show up as a weapon model. As an example, and not as what I'm doing, if I took a mdl of a chair and wanted it to be a melee weapon, what might stop it showing up, does it need anything special information or positioning etc?

cheers
me
frag.machine
Posts: 2126
Joined: Sat Nov 25, 2006 1:49 pm

Post by frag.machine »

Just the correct origin/angles offsets, the rest is business as usual. Check all occurrences of, say, "v_axe.mdl" in vanilla source for more details on the QuakeC part.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Post by Spike »

needs specific positioning.
it'll be placed at the player's origin, basically. it'll bob up and down a bit so won't be exactly there, but should be on average. it'll move forwards and back a bit as you look up and down.

less obvious things are that anything closer than 4 quake units to the view will be clipped, and so you will need to position it sufficiently far away from the origin such that the entire model will be visible.
Make it too far away, and it'll clip into walls.
(glquake has a depth hack where the depth of the viewmodel is scaled down by 3, I'm not quite sure on the maths, but keep the model between 4 and 36 units from the origin, I guess (actually, towards the middle of that range due to bob/pitch).
I don't remember which axis the model needs to be on, but it cannot be central. It must be off to one side of the center of the model.
quite a lot of weapon models bug with widescreen or such because they come closer than the 4-unit near-clip plane in areas which would not normally be visible, hence why high fov generally disables the viewmodel entirely.

You can make a model which is a viewmodel in one frame, and a world model in another, yes. But don't expect it to make sense to use the same frames in both situations.

You do still need to precache it.
Sajt
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Post by Sajt »

Spike wrote:it'll be placed at the player's origin, basically.
Well, more specifically, the player's view origin (origin + view_ofs).
Spike wrote:it'll move forwards and back a bit as you look up and down.
Only if viewsize is not full (120) or really small, I think (that is, if the sbar "pushes it up"...)
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Post Reply