Blog Labels

Ongoing (22) Freebie (15) Shields (12) Scripts (7) Ideas (6) SneakPeek (6) Architecture (5) WorldBall (5) Tattoo (4) PictureTime (3) Armour (2) Shader (2) HDRI (1) Hats (1) Poser (1) Sources (1) moan (1) website (1)

Tuesday, 27 November 2012

Ideas - Upgrade To My PropGoto+ (Part 2)

Continuing from an earlier post, it turns out that a simple solution is a 'DummyHand' prop:

Simply rotate and translate 'any old prop' till it's held correctly in the dummy hand, and then parent the prop to the dummy hand. You can now use the 'PropGoto+' on the dummy hand (not the 'any old prop' itself) and your prop will go with it.

Since the dummy hand is designed to work with the 'PropGoto+' script (i.e. size, orientation, origin, x/y/zOffsetA/B set appropriately) your 'any old prop' should now be more-or-less correctly gripped by whichever of the 28 supported figures you used (the dummy hand would need to be made invisble before rendering - I'm making it bright green so it stands out.)

I sort-of glossed over that "...Simply rotate and translate 'any old prop'..." bit - it isn't too difficult once you get the hang of the rotation order. But why not try to simplify that too?

First step -  I loaded up several props from my runtime and set all the orientation and translation values to zero to find out where they would appear. Needless to say their zeroed positions are all different - here's a few with a ghostly M4:

But that's not too bad actually. There seem to be four basic defaults (there's sure to be more, but it's a good start):
1) Vertically, positioned above the origin with one end at the origin. This seems the most popular (the greatsword is actually at 90° to the others, blade facing front-back, not left-right)
2) In a particular figure's right/left hand (e.g. the mace would fit M4's right hand, the scimitar would fit a G2 male's right hand). This seems popular too.
3) Positioned to fit into/onto another prop (e.g. the knife near Mike's right hip would fit a sheath on a G2 male's armoured hip).
4) Similar to (1), but offset from the origin.

Looking at the picture I can quite easily set the x/y/z/ rotations and translations manually to fit in the dummy hand. Doing it via a script needs some thought.

I think the keywill be to let the user specify how the prop is oriented, and then apply preset x/y/z/ rotations and translations in accordance with this. For these vertical props (criteria 1 and 4) rotations are easy:

Props with the same initial 'alignment' use the same rotation values:
- Handle at the bottom (wand and staff): x=0°, y=90°, z=0°
- Handle at top, blade left-right (two shorter swords): x= -90°, y= -90°, z=0°
- Handle at top, blade front-back (greatsword): x= -90°, y=0°, z=0°

They all need to move down now - I think the Y-value of the 'origin' in the PP2 will tell me how far.

But I can't think of a way to determine how far backward-forward along the Z-axis  they need to move - that depends on the length of the prop and which end is supposed to be gripped, which I don't think a script can determine. I think we'll have to ask for some user interaction - here's a tentative set of three questions the script can ask (for a  prop that meets criterion 1):

a) If somebody grabbed the prop with their right hand, which way would the hand be pointing? Right/Forward
b) How tall is the prop compared to a standard human? Knee-high/Waist-high/Head-high
c) Where should the hand grip it? Top/Middle/Bottom

All very tentative at this stage, and criteria 2 and 3 are more problematic, but this approach has possibilites...

(Mustn't forget that when a user loads a prop it may not have its rotations/translations set to zero...)


No comments:

Post a Comment

Go ahead, comment away!