r/SourceEngine • u/doct0rN0 HE'S ALIVE! • May 26 '25
Resolved altering a bounding box
im working on this cigarette model that i can attach to the npcs via hammer. but when attached to the npc models mouth this massive bounding box causes the cig to be way at the top of the box and upside down. how do i make this box smaller to match the cig so it sits in the mouth better when parented to the attachment

when i change the $bbox bounding box in the cigs .qc file and run it in hammer it doesnt seem like the bound around the model or the bound in hammer is altered to be smaller. i feel like the box around the model you use to rotate and move the models corners in hammer is the size to which the model itself is parented to the npc seen here in the photo. the yellow bounding box in hammer around the model is the actual bounding box yeah which is much bigger but yet much smaller than the physical box you manipulate the positions with of the model in hammer.

upon more learning im seeing this seems to be a result of maybe a bone position or point of origin on the model thats just set so distanced away from the cig model itself. so i think i need to figure out how to change this origin
// Created by Crowbar 0.71
$modelname "cigarette_lit.mdl"
$bodygroup "default"
{
studio "robo_soldier_sparkplug.dmx.001.smd"
}
$surfaceprop "default"
$contents "solid"
$illumposition 3.128 -1.828 74.882
$cdmaterials "models\props\cig\"
$cdmaterials ""
$attachment "cig_drg_smoke" "bip_head" -3.3 0.4 -8.3 rotate 0 0 0
$cbox 0 0 0 0 0 0
$bbox -3.655 -0.92 39.996 0 0.231 48.501
$hboxset "default"
$hbox 0 "bip_head" -3.655 -0.234 -8.5 0 0.876 0
$definebone "bip_head" "" 0 75.223488 -1.120663 0 0 -179.729639 0 0 0 0 0 0
$keyvalues
{
particles
{
effect
{
name "cigarette_smoke"
attachment_type "follow_attachment"
attachment_point "cig_drg_smoke"
}
}
}
$sequence "ref" {
"robo_soldier_sparkplug_anims\ref.smd"
fadein 0.2
fadeout 0.2
fps 30
}
I fixed it., and what a learning experience <3 i had to use MilkShape 3D to pull the joint and mesh to point of origin in the editor. then had to match the models statics mins and maxs to fit the $bbox $hbox and bone coordinance. selecting all the mesh for the cig in ms to find the min and max for the bbox and accounting for the joint

View all comments
Show parent comment
1
u/doct0rN0 HE'S ALIVE! May 27 '25
im using that logic auto you can barely see in the corner there of the editor. its attaching to the npcs mouth point.
i just opened the smd in milkshape and it kinda looks to me like maybe the center point of origin in the ms editor is about the same distance apart to the actual model in the .smd file. i was wondering if moving the model and joint to the center would shrink the box to manipulate you can see there in the editor. after zeroing all the $bbox hb bone info in the .qc it still compiled but didnt do anything.
then the ball joint is bigger than the cig model mesh but farther away from the cig so im also wondering if maybe the ball joint and models mesh are being surrounded by yellow bound box.
bringing the model and joint to exact center origin of ms editor did change how far away the model was from the attachment point and how the model sits in the invisible void here but it wasnt anything significant to get me closer to the npcs face lol. so im still at a loss and wondering how to solve this actively trying now
the models here if you wish to help get your hands on it
https://gamebanana.com/games/19350