Author Topic: Object with Rotating Rings not... well rotating  (Read 4479 times)

dessertmonkey
  • Newbie
  • *
  • Posts: 15
  • Karma: 0
    • View Profile
Object with Rotating Rings not... well rotating
« on: November 30, 2012, 04:38:44 pm »
I been fiddling around with trying to get a target attached to a pole with 5 rings that spin when shot via physics. While the model does react to being shot, it just falls over and none of the rings even move. The bones and collision show up fine in the model viewer

I get the feeling I'm doing something wrong here but I can't figure out what it is. :-\ Maybe you got some idea what's going on here.

Here's the file

wallworm

  • Administrator
  • Hero Member
  • *****
  • Posts: 3673
  • Karma: 101
  • Behind me?
    • View Profile
Re: Object with Rotating Rings not... well rotating
« Reply #1 on: December 01, 2012, 12:23:18 am »
This should probably be set up to use $collisionjoints in the Collision Model & Physics Rollout. However, I have not yet documented that function really well. Moreover, the current version of WWMT only allows the use of the limit option for $collisionjoints. To accomodate model effects like you are going for, I have updated my local version of WWMT to work not only with limit, but free and fixed as well (your effect will want the free option). I've also added the per-bone Damping controls too.

I've also fixed the logic so it won't ever apply $collisionjoints to any unparented (root) bones.

I may load this update tomorrow.

dessertmonkey
  • Newbie
  • *
  • Posts: 15
  • Karma: 0
    • View Profile
Re: Object with Rotating Rings not... well rotating
« Reply #2 on: December 01, 2012, 03:26:55 am »
That's nice to hear, man. I'm pretty much the only one on my mod team who's the most acquainted with this great tool but all I'm doing is reading the manual with some trial & error. Chances are, you might hear from me a few times.  ;)

I'll let you know if it works out or not tomorrow.

wallworm

  • Administrator
  • Hero Member
  • *****
  • Posts: 3673
  • Karma: 101
  • Behind me?
    • View Profile
Re: Object with Rotating Rings not... well rotating
« Reply #3 on: December 01, 2012, 12:46:42 pm »
OK, there is a new update to WW that will allow you to do the kind of thing you are attempting more easily. I also updated the docs on making ragdolls to reflect these cahnges. For convenience, I loaded a sample scene in 3ds Max 2013 format. The link and instructions for that model are at the bottom.

dessertmonkey
  • Newbie
  • *
  • Posts: 15
  • Karma: 0
    • View Profile
Re: Object with Rotating Rings not... well rotating
« Reply #4 on: December 01, 2012, 08:58:15 pm »
It seems to work fine when the reference model (RM) is the collision mesh (CM) but not when both are different. I'm getting some odd behavior such as the root object in the CM is being ignored and the ring CMs are exported at world origin even if it has Xform and looks fine in the model viewer. I even did half and half by having the rings from the RM be part of the CM as well as a simple box around the pole... it's a mess.  :(

I'm assuming the hierarchy is on the RM and the IK limit on the CM? If I have the CM in a hierarchy, it doesn't work and gives me an error in the model viewer so I'm quite puzzled.

At least your example worked as intended so there's that. If all else fails, I can just have the target glow instead using Skins.
« Last Edit: December 01, 2012, 08:59:52 pm by dessertmonkey »

wallworm

  • Administrator
  • Hero Member
  • *****
  • Posts: 3673
  • Karma: 101
  • Behind me?
    • View Profile
Re: Object with Rotating Rings not... well rotating
« Reply #5 on: December 01, 2012, 09:18:35 pm »
I don't have time to test this at the moment, but here are some hints that should send you in the right direction. If not, I will do a more detailed explanation and example file this week.

First, when using a more complex model thatn what I made where the CM is not the same model as the mesh, make sure that the root mesh (RM) and collision hull (CM) are both skinned to the same set of bones. Make sure that each piece of the CM is skinned to only one bone!

Also, make sure that ALL of the bones (except the root bone) are children of other bones (leading back to the root bone).

In this setup, the IK limits are set to the bones (not the meshes).

Also, I am not 100% but I do not think it is a good idea to use the Use Local Origin as World Origin with any model using these methods--so such model will always need to be built at world origin.

Hint... it may be helpful at times to make sure the position of a bone is aligned to the position of your root model's pivot point. Remember if you ever move an object's pivot (or scale/position/rotation) it is best to Reset XForm and collapse before applying a skin.

Hopefully that helps. If you are still having problems, just share here and I will help you on your journey... though it may take a few days depending on my time.
« Last Edit: December 02, 2012, 03:39:30 pm by wallworm »

wallworm

  • Administrator
  • Hero Member
  • *****
  • Posts: 3673
  • Karma: 101
  • Behind me?
    • View Profile
Re: Object with Rotating Rings not... well rotating
« Reply #6 on: December 02, 2012, 03:48:12 pm »
I have updated the docs page with Ragdoll example 2.

In this scene, WWMT:Pyramid002 has three meshes and three bones. There are also three collision hulls. Note that the third hull (for the outer ring) is only a small piece rather than the entire hull. This is because the hull attached to each bone must always be convex--and if covering the whole outer ring it collides and interferes with the inner bone/hull.

To see the hulls in game, use these commands in console:

sv_cheats 1
vcollide_wireframe 1

Then shoot the inner circle... and the outer hull. Unfortunately, to get something as complex as you want, it would take extra work. But this scene should give you a much better view of the process.

Note that you will have problems when exporting meshes if they don't all share the same orientation in the world--which is why they all need to have their xforms reset.

Also, the earlier notice about not using the Use Local Origin as World Origin was false. I used the local origin for the newer model.

dessertmonkey
  • Newbie
  • *
  • Posts: 15
  • Karma: 0
    • View Profile
Re: Object with Rotating Rings not... well rotating
« Reply #7 on: December 07, 2012, 03:18:04 pm »
Recreating the target from scratch, I got as far as getting the CM and RM working correctly before adding the bones and skinning them. Once I did, a whole new batch of problems start to occur. I can't even focus on testing if the physics work correctly until I can get all the bones, RM, and CM working together.

I made sure that the pivots of all the RM and CM objects matched both position and local orientation of the bones then skinned them to each bone, made the CM with multiple elements and skinned it to the root bone, and gave them all an Xform modifier before skinning them. The result winded up like this. (See attachment)

The CM was split into multiple objects in this attempt with elements attached such as the rings after the single CM failed to recognize the separate elements as concave (Is 42 too much?). I'm starting to wonder if this is a limitation of the ragdoll physics system.

Now again, this is more for testing purposes so if I can't find a way to get this to work at all then I'll just have it as a static prop instead.

------

This is abit unrelated but I been noticing that using Bridge to create the inner portions of the rings causes bad vertex data to occur. What's even stranger is that it was occurring on the sides but now is happening on the front. ??? Still haven't figured out how to get around it.

« Last Edit: December 07, 2012, 03:39:43 pm by dessertmonkey »

wallworm

  • Administrator
  • Hero Member
  • *****
  • Posts: 3673
  • Karma: 101
  • Behind me?
    • View Profile
Re: Object with Rotating Rings not... well rotating
« Reply #8 on: December 07, 2012, 03:22:59 pm »
Send a sample of your latest file that has your wwmt helper in the scene and I will see what is amiss.

dessertmonkey
  • Newbie
  • *
  • Posts: 15
  • Karma: 0
    • View Profile
Re: Object with Rotating Rings not... well rotating
« Reply #9 on: December 07, 2012, 03:43:43 pm »
Okay, I updated the link in the first post with the latest file as well as the one prior just in case.