Results 1 to 18 of 18

Thread: Bounding Spheres ....er ?

  1. #1

    Default Bounding Spheres ....er ?

    I am struggling to understand the values that these have in MS3D to get the effects you need in game. This set of numbers come from my Bone Giant. I have not scaled these up, and the bounding sphere clearly, isn't right when you have a 4 times scaled creature.

    Code:
    0.00508304
    0.2339
    0.366608
    1.31867
    /
    Now...what I can't get ( because you can't really see the effect! ) is which number does what.

    I am assuming that three of these numbers represent the X,Y,Z dimensions of the sphere... but which is which?

    My guess is the first number is ...er...something.
    The next one I assume is the depth front to back of the sphere.
    Next would be the width
    Final one the height?

    I am basing that on the relative proportions of a human being, assuming thats what these are. Does anyone know?

    For my 4 times scaled creature, should I quadruple all the values?
    Careless Orc Costs Lives!

  2. #2

    Default Re: Bounding Spheres ....er ?

    xyz of center then diameter I'd say, seems the most logical for a sphere.

  3. #3
    feed me! Member Ashdnazg's Avatar
    Join Date
    Dec 2006
    Location
    Haifa, Israel
    Posts
    54

    Default Re: Bounding Spheres ....er ?

    Doesn't a sphere mean x,y,z,r?
    {x,y,z} is the location of the centre, and r is the radius.
    so if you make it 4 times larger, quadrupling might do the trick.
    a.k.a Lord hokomoko @ the Lordz Modding Collective

  4. #4

    Default Re: Bounding Spheres ....er ?

    radius would be right, quadrupling the values wouldnt neccessarily work if they're xyz though, the centre would have to be recalculated I think.

  5. #5
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default Re: Bounding Spheres ....er ?

    If that's indeed a sphere, most of it is below the ground
    How large is the soldier? Maybe that's intended.
    If so, to make the sphere four times as high you should increase the radius and z value of the center by a factor of 4

  6. #6

    Default Re: Bounding Spheres ....er ?

    Alpaca ... this is part of what is confusing me. Those are STOCK numbers from a stock unit. I have tried scaling up certain values, but I can't see any obvious changes. I need to be confident that the unit, when scaled up, is able to engage an enemy in the correct place, and is attacked in the roght way.
    Careless Orc Costs Lives!

  7. #7

    Default Re: Bounding Spheres ....er ?

    Hi Bwian and Alpaca
    Quote Originally Posted by alpaca
    If that's indeed a sphere, most of it is below the ground How large is the soldier? Maybe that's intended. If so, to make the sphere four times as high you should increase the radius and z value of the center by a factor of 4
    Don't think of the sphere as a separate entity or you'll do your head in. Think of it as attached to the bone_pelvis, when you're working on a mesh the bone_pelvis is at 0,0,0 so the sphere is set to cover it above and below the origin. Below is a Milkshape ascii model of a unit sphere (centred 0,0,0 and 1 unit radius) copy and save as a txt file, import it into Milkshape and move and scale it appropriately and this will give you a visual clue on the position and size of the bounding sphere:-
    Spoiler Alert, click show to read: 
    // // MilkShape 3D ASCII

    Frames: 1
    Frame: 0

    Meshes: 1
    "Sphere01" 1 -1
    89
    1 -0.001734 -0.997955 0.001275 0.000000 1.000000 -1
    1 0.497243 -0.864254 0.001275 0.000000 0.833333 -1
    1 0.430393 -0.864254 0.250764 0.083333 0.833333 -1
    1 -0.001734 0.997955 0.001275 0.000000 0.000000 -1
    1 0.430393 0.864254 0.250764 0.083333 0.166667 -1
    1 0.497243 0.864254 0.001275 0.000000 0.166667 -1
    1 -0.001734 -0.997955 0.001275 0.083333 1.000000 -1
    1 0.247754 -0.864254 0.433402 0.166667 0.833333 -1
    1 -0.001734 0.997955 0.001275 0.083333 0.000000 -1
    1 0.247754 0.864254 0.433402 0.166667 0.166667 -1
    1 -0.001734 -0.997955 0.001275 0.166667 1.000000 -1
    1 -0.001734 -0.864254 0.500252 0.250000 0.833333 -1
    1 -0.001734 0.997955 0.001275 0.166667 0.000000 -1
    1 -0.001734 0.864254 0.500252 0.250000 0.166667 -1
    1 -0.001734 -0.997955 0.001275 0.250000 1.000000 -1
    1 -0.251223 -0.864254 0.433402 0.333333 0.833333 -1
    1 -0.001734 0.997955 0.001275 0.250000 0.000000 -1
    1 -0.251223 0.864254 0.433402 0.333333 0.166667 -1
    1 -0.001734 -0.997955 0.001275 0.333333 1.000000 -1
    1 -0.433862 -0.864254 0.250764 0.416667 0.833333 -1
    1 -0.001734 0.997955 0.001275 0.333333 0.000000 -1
    1 -0.433862 0.864254 0.250764 0.416667 0.166667 -1
    1 -0.001734 -0.997955 0.001275 0.416667 1.000000 -1
    1 -0.500712 -0.864254 0.001275 0.500000 0.833333 -1
    1 -0.001734 0.997955 0.001275 0.416667 0.000000 -1
    1 -0.500712 0.864254 0.001275 0.500000 0.166667 -1
    1 -0.001734 -0.997955 0.001275 0.500000 1.000000 -1
    1 -0.433862 -0.864254 -0.248214 0.583333 0.833333 -1
    1 -0.001734 0.997955 0.001275 0.500000 0.000000 -1
    1 -0.433862 0.864254 -0.248214 0.583333 0.166667 -1
    1 -0.001734 -0.997955 0.001275 0.583333 1.000000 -1
    1 -0.251223 -0.864254 -0.430852 0.666667 0.833333 -1
    1 -0.001734 0.997955 0.001275 0.583333 0.000000 -1
    1 -0.251223 0.864254 -0.430852 0.666667 0.166667 -1
    1 -0.001734 -0.997955 0.001275 0.666667 1.000000 -1
    1 -0.001734 -0.864254 -0.497703 0.750000 0.833333 -1
    1 -0.001734 0.997955 0.001275 0.666667 0.000000 -1
    1 -0.001734 0.864254 -0.497703 0.750000 0.166667 -1
    1 -0.001734 -0.997955 0.001275 0.750000 1.000000 -1
    1 0.247754 -0.864254 -0.430852 0.833333 0.833333 -1
    1 -0.001734 0.997955 0.001275 0.750000 0.000000 -1
    1 0.247754 0.864254 -0.430852 0.833333 0.166667 -1
    1 -0.001734 -0.997955 0.001275 0.833333 1.000000 -1
    1 0.430393 -0.864254 -0.248214 0.916667 0.833333 -1
    1 -0.001734 0.997955 0.001275 0.833333 0.000000 -1
    1 0.430393 0.864254 -0.248214 0.916667 0.166667 -1
    1 -0.001734 -0.997955 0.001275 0.916667 1.000000 -1
    1 0.497243 -0.864254 0.001275 1.000000 0.833333 -1
    1 -0.001734 0.997955 0.001275 0.916667 0.000000 -1
    1 0.497243 0.864254 0.001275 1.000000 0.166667 -1
    1 0.862520 -0.498977 0.001275 0.000000 0.666667 -1
    1 0.746732 -0.498977 0.433402 0.083333 0.666667 -1
    1 0.430393 -0.498977 0.749741 0.166667 0.666667 -1
    1 -0.001734 -0.498977 0.865529 0.250000 0.666667 -1
    1 -0.433862 -0.498977 0.749741 0.333333 0.666667 -1
    1 -0.750201 -0.498977 0.433402 0.416667 0.666667 -1
    1 -0.865989 -0.498977 0.001275 0.500000 0.666667 -1
    1 -0.750201 -0.498977 -0.430852 0.583333 0.666667 -1
    1 -0.433862 -0.498977 -0.747191 0.666667 0.666667 -1
    1 -0.001734 -0.498977 -0.862980 0.750000 0.666667 -1
    1 0.430393 -0.498977 -0.747191 0.833333 0.666667 -1
    1 0.746732 -0.498977 -0.430852 0.916667 0.666667 -1
    1 0.862520 -0.498977 0.001275 1.000000 0.666667 -1
    1 0.996221 0.000000 0.001275 0.000000 0.500000 -1
    1 0.862520 0.000000 0.500252 0.083333 0.500000 -1
    1 0.497243 0.000000 0.865529 0.166667 0.500000 -1
    1 -0.001734 0.000000 0.999230 0.250000 0.500000 -1
    1 -0.500712 0.000000 0.865529 0.333333 0.500000 -1
    1 -0.865989 0.000000 0.500252 0.416667 0.500000 -1
    1 -0.999690 0.000000 0.001275 0.500000 0.500000 -1
    1 -0.865989 0.000000 -0.497703 0.583333 0.500000 -1
    1 -0.500712 0.000000 -0.862980 0.666667 0.500000 -1
    1 -0.001734 0.000000 -0.996680 0.750000 0.500000 -1
    1 0.497243 0.000000 -0.862980 0.833333 0.500000 -1
    1 0.862520 0.000000 -0.497703 0.916667 0.500000 -1
    1 0.996221 0.000000 0.001275 1.000000 0.500000 -1
    1 0.862520 0.498978 0.001275 0.000000 0.333333 -1
    1 0.746732 0.498978 0.433402 0.083333 0.333333 -1
    1 0.430393 0.498978 0.749741 0.166667 0.333333 -1
    1 -0.001734 0.498978 0.865529 0.250000 0.333333 -1
    1 -0.433862 0.498978 0.749741 0.333333 0.333333 -1
    1 -0.750201 0.498978 0.433402 0.416667 0.333333 -1
    1 -0.865989 0.498978 0.001275 0.500000 0.333333 -1
    1 -0.750201 0.498978 -0.430852 0.583333 0.333333 -1
    1 -0.433862 0.498978 -0.747191 0.666667 0.333333 -1
    1 -0.001734 0.498978 -0.862980 0.750000 0.333333 -1
    1 0.430393 0.498978 -0.747191 0.833333 0.333333 -1
    1 0.746732 0.498978 -0.430852 0.916667 0.333333 -1
    1 0.862520 0.498978 0.001275 1.000000 0.333333 -1
    62
    0.000000 -1.000000 -0.000000
    0.573584 -0.819147 -0.000000
    0.431481 -0.867044 0.249116
    0.000000 1.000000 -0.000000
    0.431481 0.867044 0.249116
    0.573584 0.819147 -0.000000
    0.286792 -0.819147 0.496738
    0.286792 0.819147 0.496738
    0.000000 -0.867044 0.498231
    0.000000 0.867044 0.498231
    -0.286792 -0.819147 0.496738
    -0.286792 0.819147 0.496738
    -0.431481 -0.867044 0.249116
    -0.431481 0.867044 0.249116
    -0.573584 -0.819147 -0.000000
    -0.573584 0.819147 -0.000000
    -0.431481 -0.867044 -0.249116
    -0.431481 0.867044 -0.249116
    -0.286792 -0.819147 -0.496738
    -0.286792 0.819147 -0.496738
    0.000000 -0.867044 -0.498231
    0.000000 0.867044 -0.498231
    0.286792 -0.819147 -0.496738
    0.286792 0.819147 -0.496738
    0.431481 -0.867044 -0.249116
    0.431481 0.867044 -0.249116
    0.865033 -0.501714 -0.000000
    0.749141 -0.501714 0.432517
    0.432517 -0.501714 0.749141
    0.000000 -0.501714 0.865033
    -0.432517 -0.501714 0.749141
    -0.749141 -0.501714 0.432517
    -0.865033 -0.501714 -0.000000
    -0.749141 -0.501714 -0.432517
    -0.432517 -0.501714 -0.749141
    0.000000 -0.501714 -0.865033
    0.432517 -0.501714 -0.749141
    0.749141 -0.501714 -0.432517
    1.000000 0.000000 -0.000000
    0.866025 0.000000 0.500000
    0.500000 0.000000 0.866025
    0.000000 0.000000 1.000000
    -0.500000 0.000000 0.866025
    -0.866025 0.000000 0.500000
    -1.000000 0.000000 -0.000000
    -0.866025 0.000000 -0.500000
    -0.500000 0.000000 -0.866025
    0.000000 0.000000 -1.000000
    0.500000 0.000000 -0.866025
    0.866025 0.000000 -0.500000
    0.865033 0.501714 -0.000000
    0.749141 0.501714 0.432517
    0.432517 0.501714 0.749141
    0.000000 0.501714 0.865033
    -0.432517 0.501714 0.749141
    -0.749141 0.501714 0.432517
    -0.865033 0.501714 -0.000000
    -0.749141 0.501714 -0.432517
    -0.432517 0.501714 -0.749141
    0.000000 0.501715 -0.865033
    0.432517 0.501714 -0.749141
    0.749141 0.501714 -0.432517
    120
    1 0 1 2 0 1 2 1
    1 3 4 5 3 4 5 1
    1 6 2 7 0 2 6 1
    1 8 9 4 3 7 4 1
    1 10 7 11 0 6 8 1
    1 12 13 9 3 9 7 1
    1 14 11 15 0 8 10 1
    1 16 17 13 3 11 9 1
    1 18 15 19 0 10 12 1
    1 20 21 17 3 13 11 1
    1 22 19 23 0 12 14 1
    1 24 25 21 3 15 13 1
    1 26 23 27 0 14 16 1
    1 28 29 25 3 17 15 1
    1 30 27 31 0 16 18 1
    1 32 33 29 3 19 17 1
    1 34 31 35 0 18 20 1
    1 36 37 33 3 21 19 1
    1 38 35 39 0 20 22 1
    1 40 41 37 3 23 21 1
    1 42 39 43 0 22 24 1
    1 44 45 41 3 25 23 1
    1 46 43 47 0 24 1 1
    1 48 49 45 3 5 25 1
    1 1 50 51 1 26 27 1
    1 1 51 2 1 27 2 1
    1 2 51 7 2 27 6 1
    1 51 52 7 27 28 6 1
    1 7 52 53 6 28 29 1
    1 7 53 11 6 29 8 1
    1 11 53 15 8 29 10 1
    1 53 54 15 29 30 10 1
    1 15 54 55 10 30 31 1
    1 15 55 19 10 31 12 1
    1 19 55 23 12 31 14 1
    1 55 56 23 31 32 14 1
    1 23 56 57 14 32 33 1
    1 23 57 27 14 33 16 1
    1 27 57 31 16 33 18 1
    1 57 58 31 33 34 18 1
    1 31 58 59 18 34 35 1
    1 31 59 35 18 35 20 1
    1 35 59 39 20 35 22 1
    1 59 60 39 35 36 22 1
    1 39 60 61 22 36 37 1
    1 39 61 43 22 37 24 1
    1 43 61 47 24 37 1 1
    1 61 62 47 37 26 1 1
    1 50 63 51 26 38 27 1
    1 63 64 51 38 39 27 1
    1 51 64 65 27 39 40 1
    1 51 65 52 27 40 28 1
    1 52 65 53 28 40 29 1
    1 65 66 53 40 41 29 1
    1 53 66 67 29 41 42 1
    1 53 67 54 29 42 30 1
    1 54 67 55 30 42 31 1
    1 67 68 55 42 43 31 1
    1 55 68 69 31 43 44 1
    1 55 69 56 31 44 32 1
    1 56 69 57 32 44 33 1
    1 69 70 57 44 45 33 1
    1 57 70 71 33 45 46 1
    1 57 71 58 33 46 34 1
    1 58 71 59 34 46 35 1
    1 71 72 59 46 47 35 1
    1 59 72 73 35 47 48 1
    1 59 73 60 35 48 36 1
    1 60 73 61 36 48 37 1
    1 73 74 61 48 49 37 1
    1 61 74 75 37 49 38 1
    1 61 75 62 37 38 26 1
    1 63 76 77 38 50 51 1
    1 63 77 64 38 51 39 1
    1 64 77 65 39 51 40 1
    1 77 78 65 51 52 40 1
    1 65 78 79 40 52 53 1
    1 65 79 66 40 53 41 1
    1 66 79 67 41 53 42 1
    1 79 80 67 53 54 42 1
    1 67 80 81 42 54 55 1
    1 67 81 68 42 55 43 1
    1 68 81 69 43 55 44 1
    1 81 82 69 55 56 44 1
    1 69 82 83 44 56 57 1
    1 69 83 70 44 57 45 1
    1 70 83 71 45 57 46 1
    1 83 84 71 57 58 46 1
    1 71 84 85 46 58 59 1
    1 71 85 72 46 59 47 1
    1 72 85 73 47 59 48 1
    1 85 86 73 59 60 48 1
    1 73 86 87 48 60 61 1
    1 73 87 74 48 61 49 1
    1 74 87 75 49 61 38 1
    1 87 88 75 61 50 38 1
    1 76 5 77 50 5 51 1
    1 5 4 77 5 4 51 1
    1 77 4 9 51 4 7 1
    1 77 9 78 51 7 52 1
    1 78 9 79 52 7 53 1
    1 9 13 79 7 9 53 1
    1 79 13 17 53 9 11 1
    1 79 17 80 53 11 54 1
    1 80 17 81 54 11 55 1
    1 17 21 81 11 13 55 1
    1 81 21 25 55 13 15 1
    1 81 25 82 55 15 56 1
    1 82 25 83 56 15 57 1
    1 25 29 83 15 17 57 1
    1 83 29 33 57 17 19 1
    1 83 33 84 57 19 58 1
    1 84 33 85 58 19 59 1
    1 33 37 85 19 21 59 1
    1 85 37 41 59 21 23 1
    1 85 41 86 59 23 60 1
    1 86 41 87 60 23 61 1
    1 41 45 87 23 25 61 1
    1 87 45 49 61 25 5 1
    1 87 49 88 61 5 50 1

    Materials: 0

    Bones: 0
    GroupComments: 0
    MaterialComments: 0
    BoneComments: 0
    ModelComment: 0


    edit - Sorry for some reason it's taking all the line breaks out of the spoiler - looked fine in the preview? I'll try again later.

    edit2 - That's better.

    If you're just doing the scaling changes to the anims, etc my guess is that this sphere is scaled as well.

    Cheers

    GrumpyOldMan
    Last edited by GrumpyOldMan; 06-08-2007 at 02:42.

  8. #8

    Default Re: Bounding Spheres ....er ?

    0 on the z plane isnt ground level if thats what you're thinking. Just looked at one of the jannisarys and the bounding sphere looks to encompass the model in the base pose with the arms spread out, so i dont see how it'd have any effect other than basic collison detection.

    edit, goms reply wasnt there when I hit the reply button, sorry for repeating him

    @Gom, what should it encompass exactly, bwians model is fairly large with a fairly large weapon to boot, to get it all in you'd need a radius of about 7.
    Last edited by Casuir; 06-08-2007 at 02:59.

  9. #9

    Default Re: Bounding Spheres ....er ?

    Hi Casuir

    Quote Originally Posted by Casuir
    0 on the z plane isnt ground level if thats what you're thinking. Just looked at one of the jannisarys and the bounding sphere looks to encompass the model in the base pose with the arms spread out, so i dont see how it'd have any effect other than basic collison detection.

    edit, goms reply wasnt there when I hit the reply button, sorry for repeating him
    No problems, having someone confirm what I say just releases the pressure from me that I might be talking gibberish (again)

    Quote Originally Posted by Casuir
    @Gom, what should it encompass exactly, bwians model is fairly large with a fairly large weapon to boot, to get it all in you'd need a radius of about 7.
    If Bwian is using scaling to increase the size of his figures, I'm pretty sure that the bounding sphere would be scaled up as well, if so he should leave it at vanilla figure size. If he's creating a new figure it has to cover most of the body and the majority of the melee weapon. I don't think that the bounding sphere is just collision info because of the discrepancy between values for a swordsman and a pike man, and the increase in the z component for a mounted figure, maybe it's attack collision info?

    Cheers

    GrumpyOldMan

  10. #10

    Default Re: Bounding Spheres ....er ?

    Had a look at some of the figures, the x values seem to be reversed, I think I recall you saying something about medievals co-ords being reversed on the x axis somewhere gom, the converter catching this with regards to bounding spheres? The pikemen and lancer models spheres encompass all of their model including the weapon in the basepose, so the centre is going to be different for
    every model. Quadrupling the values wont necessarily give you the best values. Some rough values for the bone giant bwian:
    -0.244
    -0.348
    2.850
    5.234

  11. #11
    Member Member KnightErrant's Avatar
    Join Date
    Jan 2007
    Location
    Huntsville, Alabama USA
    Posts
    458

    Default Re: Bounding Spheres ....er ?

    The conversion between CA's convention and Milkshape is
    change the sign of the x-component of vectors and reverse
    handedness of triangles. The bounding sphere data is just
    written to the model comment and read out again so the
    numbers in Milkshape are still for CA's mesh convention.

  12. #12

    Default Re: Bounding Spheres ....er ?

    Thats not the case though if you make a new bounding sphere based on a new model, the x values on the model are reversed but not the sphere. Minor thing thats easy to do by hand though.

  13. #13
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default Re: Bounding Spheres ....er ?

    I think the bounding sphere is important for arrow collision detection.
    If you zoom in close and play on low speed you'll see that units get bloody but aren't actually hit by the arrows sometimes. That's also what I was hinted to by a dev, if I interpreted that correctly.

    As for the sphere: Isn't it set in the comments, so it'd stay the same size when you just scale your unit's model?

  14. #14
    Member Member KnightErrant's Avatar
    Join Date
    Jan 2007
    Location
    Huntsville, Alabama USA
    Posts
    458

    Default Re: Bounding Spheres ....er ?

    I think GrumpyOldMan is correct, (I'm almost never wrong for saying that),
    If you scale a model using descr_skeletons.txt scale command the bounding
    sphere should scale with it. If you scale a model in Milkshape then, of course,
    the model comments stay static, and get reimported into the mesh without
    change.

  15. #15
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default Re: Bounding Spheres ....er ?

    Quote Originally Posted by KnightErrant
    I think GrumpyOldMan is correct, (I'm almost never wrong for saying that),
    If you scale a model using descr_skeletons.txt scale command the bounding
    sphere should scale with it. If you scale a model in Milkshape then, of course,
    the model comments stay static, and get reimported into the mesh without
    change.
    Ah well I was under the impression that he scaled the model directly because he said the bounding sphere didn't fit

  16. #16
    feed me! Member Ashdnazg's Avatar
    Join Date
    Dec 2006
    Location
    Haifa, Israel
    Posts
    54

    Default Re: Bounding Spheres ....er ?

    When experiementing with EDU I couldn't make the soldiers too close to each other, perhaps the value can't be smaller than R.
    Try to use a small r, and in the formation line in EDU make them very close to each other.
    a.k.a Lord hokomoko @ the Lordz Modding Collective

  17. #17

    Default Re: Bounding Spheres ....er ?

    That's unlikely given the large radius of pikemen and lance equipped cavalry. The use for projectile targeting seems to suggest that some troops are at a disadvantage here.


    Quote Originally Posted by alpaca
    Ah well I was under the impression that he scaled the model directly because he said the bounding sphere didn't fit
    You are correct he has. Relying on descr_skeleton to scale the sphere is only going to work if the original bounding sphere fits the model. Doing it by hand quadrupling the values isnt going to work when 0,0,0 is in the centre of the model. Looking at the rough values I got the values seem to be roughly 4,0,8,4 times the orginal ones though wouldnt rely on that as a mathemathical formula.

    @Gom, out of curiosity are there bounding sphere values for the weaponless meshs used to create the units?

  18. #18

    Default Re: Bounding Spheres ....er ?

    The scaling was done in MS3D, with scaling also applied in modeldb and in descr_skeleton. If ....as has been stated here ... .that process also scales the bounding sphere, what visual tell-tales should I be looking for to see if htat has happened? I assumed the sphere was going to be used for combat collision detecting to see which unit was in a position to attack what. The scaled up skeletons didn't seem to attack units where I would expect it ... I wanted to push away the point at which combat was deemed to happen, to make it look more natural.

    Does the bounding sphere have any impact on this at all.... and how do I test this. I can't tell from what I have seen if I am changing hte right thing to cause what I want to happen!
    Careless Orc Costs Lives!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO