3d:: 3D models are now centered correctly instead of on legs

This commit is contained in:
? 2019-02-27 18:59:21 +01:00 committed by Zeno Rogue
parent a9a02e0f8f
commit 1a8f164572
2 changed files with 31 additions and 23 deletions

View File

@ -274,9 +274,9 @@ namespace geom3 {
ld INFDEEP, BOTTOM, HELLSPIKE, LAKE, WALL,
SLEV[4], FLATEYE,
LEG1, LEG, LEG3, GROIN, GROIN1, GHOST,
LEG0, LEG1, LEG, LEG3, GROIN, GROIN1, GHOST,
BODY, NECK1, NECK, NECK3, HEAD, HEAD1, HEAD2,
ALEG, ABODY, AHEAD, BIRD;
ALEG0, ALEG, ABODY, AHEAD, BIRD;
string invalid;
@ -341,25 +341,32 @@ namespace geom3 {
WALL = lev_to_factor(wh);
human_height = human_wall_ratio * wh;
if(DIM == 3) human_height *= 1.5;
ld reduce = (DIM == 3 ? human_height / 2 : 0);
LEG1 = lev_to_factor(human_height * .1);
LEG = lev_to_factor(human_height * .2);
LEG3 = lev_to_factor(human_height * .3);
GROIN = lev_to_factor(human_height * .4);
GROIN1= lev_to_factor(human_height * .5);
BODY = lev_to_factor(human_height * .6);
NECK1 = lev_to_factor(human_height * .7);
NECK = lev_to_factor(human_height * .8);
NECK3 = lev_to_factor(human_height * .9);
HEAD = lev_to_factor(human_height * .98);
HEAD1 = lev_to_factor(human_height * .99);
LEG0 = lev_to_factor(human_height * .0 - reduce);
LEG1 = lev_to_factor(human_height * .1 - reduce);
LEG = lev_to_factor(human_height * .2 - reduce);
LEG3 = lev_to_factor(human_height * .3 - reduce);
GROIN = lev_to_factor(human_height * .4 - reduce);
GROIN1= lev_to_factor(human_height * .5 - reduce);
BODY = lev_to_factor(human_height * .6 - reduce);
NECK1 = lev_to_factor(human_height * .7 - reduce);
NECK = lev_to_factor(human_height * .8 - reduce);
NECK3 = lev_to_factor(human_height * .9 - reduce);
HEAD = lev_to_factor(human_height * .98 - reduce);
HEAD1 = lev_to_factor(human_height * .99 - reduce);
HEAD2 = lev_to_factor(human_height);
ABODY = lev_to_factor(human_height * .4);
ALEG = lev_to_factor(human_height * .2);
AHEAD = lev_to_factor(human_height * .6);
BIRD = lev_to_factor((human_wall_ratio+1)/2 * wh * .8);
GHOST = lev_to_factor(human_height * .5);
reduce = (DIM == 3 ? human_height * .3 : 0);
ABODY = lev_to_factor(human_height * .4 - reduce);
ALEG0 = lev_to_factor(human_height * .0 - reduce);
ALEG = lev_to_factor(human_height * .2 - reduce);
AHEAD = lev_to_factor(human_height * .6 - reduce);
BIRD = lev_to_factor(DIM == 3 ? 0 : (human_wall_ratio+1)/2 * wh * .8);
GHOST = lev_to_factor(DIM == 3 ? 0 : human_height * .5);
FLATEYE = lev_to_factor(human_height * .15);
slev = rock_wall_ratio * wh / 3;

View File

@ -496,11 +496,12 @@ void animallegs(const transmatrix& V, eMonster mo, color_t col, double footphase
hpcshape **x = sh[mo == moRagingBull ? 5 : mo == moBug0 ? 3 : mo == moMetalBeast ? 4 : mo == moRunDog ? 0 : mo == moReptile ? 2 : 1];
if(x[0]) queuepolyat(V * xpush(rightfoot), *x[0], col, PPR::MONSTER_FOOT);
if(x[0]) queuepolyat(V * Mirror * xpush(leftfoot), *x[0], col, PPR::MONSTER_FOOT);
if(x[1]) queuepolyat(V * xpush(-rightfoot), *x[1], col, PPR::MONSTER_FOOT);
if(x[1]) queuepolyat(V * Mirror * xpush(-leftfoot), *x[1], col, PPR::MONSTER_FOOT);
static const transmatrix VL = (DIM == 2 ? V : mmscale(V, geom3::ALEG0));
if(x[0]) queuepolyat(VL * xpush(rightfoot), *x[0], col, PPR::MONSTER_FOOT);
if(x[0]) queuepolyat(VL * Mirror * xpush(leftfoot), *x[0], col, PPR::MONSTER_FOOT);
if(x[1]) queuepolyat(VL * xpush(-rightfoot), *x[1], col, PPR::MONSTER_FOOT);
if(x[1]) queuepolyat(VL * Mirror * xpush(-leftfoot), *x[1], col, PPR::MONSTER_FOOT);
if(x[2]) queuepolyat(VAML * xpush(rightfoot/2), *x[2], col, PPR::MONSTER_FOOT);
if(x[2]) queuepolyat(VAML * Mirror * xpush(leftfoot/2), *x[2], col, PPR::MONSTER_FOOT);
@ -526,7 +527,7 @@ void ShadowV(const transmatrix& V, const hpcshape& bp, PPR prio) {
#if CAP_SHAPES
transmatrix otherbodyparts(const transmatrix& V, color_t col, eMonster who, double footphase) {
#define VFOOT V
#define VFOOT (DIM == 2 ? V : mmscale(V, geom3::LEG0))
#define VLEG mmscale(V, geom3::LEG)
#define VGROIN mmscale(V, geom3::GROIN)
#define VBODY mmscale(V, geom3::BODY)