Forum

Half-life.MDL support

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

Half-life.MDL support

Postby ceriux » Thu Jan 08, 2009 9:16 am

No... sorry i havnt written a tutorial on how to implement it.... but id like to see it done... because i was informed it wasnt in DP... that being said i was also told that LH didnt have any of the specs required to know how to do it and also him and his team arnt working on dp atm. so before i herd that last part i went through and did a little research on where to get the specs for it.

so far i found ....

the source for the original half-life mdl viewer (which im sure everything needed could be found there)

http://chumbalum.swissquake.ch/files/hlmv125.zip

and a really good mdl viewer for hl i found and used (jeds hlmdl viewer) i couldnt find a source for his program but he is contactable on his website if his email is still valid.

which the info and his website is here:

http://www.wunderboy.org/apps/jhlmv.php

the reason i bring this up is id like to see a tutorial on how to do it, so i can maybe try and attempt to implement it.

if this is done we should (afaik) be able to include sub-models which would help alot of things! (3rd person viewable weapon models and save on free edicts- i think the word was.)

anyways this is my little begging session for a tutorial on how to implement the format into glquake. thanks for your time and reading my thread. try not to flame me too bad if its a stupid request.
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby leileilol » Thu Jan 08, 2009 10:22 am

FTEQW has support for HL mdl, and it doesn't involve the non-Free sources you posted.
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Postby ceriux » Thu Jan 08, 2009 11:16 am

what do you mean non free? you dont have to pay for those...
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby Baker » Thu Jan 08, 2009 12:09 pm

ceriux wrote:what do you mean non free? you dont have to pay for those...


Non-free means -- among other things -- the license agreement with the source code.
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby MauveBib » Thu Jan 08, 2009 12:19 pm

Free as in speech, not free as in beer.
Apathy Now!
User avatar
MauveBib
 
Posts: 634
Joined: Thu Nov 04, 2004 1:22 am

Postby Baker » Thu Jan 08, 2009 11:58 pm

FTEQW's gl_hlmdl.c:

I wonder how the QuakeC looks and how the QuakeC would control all of this ... :?:

Code: Select all
#include "quakedef.h"

#ifdef HALFLIFEMODELS

#include "glquake.h"
/*
 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    Half-Life Model Renderer (Experimental) Copyright (C) 2001 James 'Ender' Brown [ender@quakesrc.org] This program is
    free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as
    published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
    This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
    warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    details. You should have received a copy of the GNU General Public License along with this program; if not, write
    to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. fromquake.h -
   
   render.c - apart from calculations (mostly range checking or value conversion code is a mix of standard Quake 1
   meshing, and vertex deforms. The rendering loop uses standard Quake 1 drawing, after SetupBones deforms the vertex.
 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



  Also, please note that it won't do all hl models....
  Nor will it work 100%
 */
#include "model_hl.h"

void QuaternionGLMatrix(float x, float y, float z, float w, vec4_t *GLM)
{
    GLM[0][0] = 1 - 2 * y * y - 2 * z * z;
    GLM[1][0] = 2 * x * y + 2 * w * z;
    GLM[2][0] = 2 * x * z - 2 * w * y;
    GLM[0][1] = 2 * x * y - 2 * w * z;
    GLM[1][1] = 1 - 2 * x * x - 2 * z * z;
    GLM[2][1] = 2 * y * z + 2 * w * x;
    GLM[0][2] = 2 * x * z + 2 * w * y;
    GLM[1][2] = 2 * y * z - 2 * w * x;
    GLM[2][2] = 1 - 2 * x * x - 2 * y * y;
}

/*
 =======================================================================================================================
    QuaternionGLAngle - Convert a GL angle to a quaternion matrix
 =======================================================================================================================
 */
void QuaternionGLAngle(const vec3_t angles, vec4_t quaternion)
{
    /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
    float   yaw = angles[2] * 0.5;
    float   pitch = angles[1] * 0.5;
    float   roll = angles[0] * 0.5;
    float   siny = sin(yaw);
    float   cosy = cos(yaw);
    float   sinp = sin(pitch);
    float   cosp = cos(pitch);
    float   sinr = sin(roll);
    float   cosr = cos(roll);
    /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

    quaternion[0] = sinr * cosp * cosy - cosr * sinp * siny;
    quaternion[1] = cosr * sinp * cosy + sinr * cosp * siny;
    quaternion[2] = cosr * cosp * siny - sinr * sinp * cosy;
    quaternion[3] = cosr * cosp * cosy + sinr * sinp * siny;
}

#define MAX_BONES 128

...
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby Downsider » Mon Jan 12, 2009 5:44 pm

Interesting; how would all that be controlled? Would you just load your models like a regular model?
User avatar
Downsider
 
Posts: 621
Joined: Tue Sep 16, 2008 1:35 am

Postby Baker » Mon Jan 12, 2009 8:47 pm

Downsider wrote:Interesting; how would all that be controlled? Would you just load your models like a regular model?


I don't know. Yet.

It'll have to invest time on researching it.

Or examine DarkPlaces and look at dpmodel and see how that works.
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby Spike » Wed Jan 14, 2009 5:35 pm

The quakec is horrible, only csqc has full control over it.
regular qc subframe blends are locked at 50%, as are bone controlers. thus you loose all the usefulness of the format.

csqc has extra fields to blend stuff properly.

I never did bother making a csqc mod animate it fully, although I think the engine is capable of all the animation stuff barring drawing subsections of models (different scientists have different details on them but are the same model). don't think it supports the chrome stuff either.

fte's hl model code is based on the source that ender released on quakesrc ages ago.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby Zylyx_ » Sat Jan 17, 2009 2:42 pm

This might perhaps sound stupid, but why dont you just convert the HL MDL's into the DP .dpm file foprmat, and rename the extension back to .mdl and there you go.

Or maybe you want something more...
....noodle...
Zylyx_
 
Posts: 111
Joined: Wed Dec 05, 2007 6:52 pm
Location: scotland, uk


Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest