Sat, Feb 8, 5:17 PM CST

Renderosity Forums / Poser - OFFICIAL



Welcome to the Poser - OFFICIAL Forum

Forum Coordinators: RedPhantom

Poser - OFFICIAL F.A.Q (Last Updated: 2025 Feb 08 9:27 am)



Subject: How do I make a ball spin automatically by changing its x position in Poser?


acrionx ( ) posted Tue, 15 February 2011 at 1:04 AM · edited Sat, 08 February 2025 at 5:10 PM

How do I make it so that if I spin the dial for the x position, for example, the ball automatically rotates about the y axis and rotates by the correct amount (rotation = distance_travelled/Radius)?  Does this involve writing a script or something?   It would certainly help me animate things easier.

www.acrionx.com | My Freebies | My Store | My Youtube Channel


SteveJax ( ) posted Tue, 15 February 2011 at 1:38 AM

You need to describe what you're talking about with a little more detail. It's easy to just spin a ball with the Y Rotate dial. If you want the ball to "Orbit" something, You'll need to move the ball's "Point of Origin" out away from the body of the sphere using the joint editor and again, spin the Y rotate dial.


Adom ( ) posted Tue, 15 February 2011 at 4:43 AM

You need simple version of ERC (Enhanced Remote Control). Just wait for someone who knows for sure how to make it - I could do some mistakes while explaining since I haven't done this for a long time.


ockham ( ) posted Tue, 15 February 2011 at 7:01 AM · edited Tue, 15 February 2011 at 7:15 AM

file_465532.txt

The ERC code would belong in the Xrotate parameter.  Before adding the code, the Xrotate parameter's paragraph will look like this:

=================

        rotateX xRotate
            {
            name xrot
            initValue 0
            hidden 0
            forceLimits 0
            min -100000
            max 100000
            trackingScale 1
            keys
                {
                static  0
                k  0  0
                }
            interpStyleLocked 0
            }

====================

You'd add the ERC so the paragraph now looks like this:

======================

        rotateX xRotate
            {
            name xrot
            initValue 0
            hidden 0
            forceLimits 0
            min -100000
            max 100000
            trackingScale 1
            keys
                {
                static  0
                k  0  0
                }

            interpStyleLocked 0
            valueOpDeltaAdd
                NO_FIG
                Ball
                xRot
            deltaAddDelta 1.000000
            }

=====================

The NO_FIG is important; the next line (ball) doesn't really matter but has to be there. And the attached file is a script that will give you the correct number to use in deltaAddDelta instead of the 1.000000 in the above text. 

Select the prop, run the script.  It will calculate the prop's diameter and tell you the number for deltaAddDelta.  (I use this all the time when making car models, for the "drive forward" dial.)  The script also works for a body part, as in a wheel.

Download the attached Diameterfinder.py.txt and take off the .txt extension before using.

My python page
My ShareCG freebies


acrionx ( ) posted Tue, 15 February 2011 at 8:19 AM

Thanks ockham!  I'll give it a try.

www.acrionx.com | My Freebies | My Store | My Youtube Channel


lesbentley ( ) posted Tue, 15 February 2011 at 1:23 PM

Almost what ockham said. It's a bit ambiguous what you mean by "x position", but I take this to mean xTranslation.

You put the code in the channel that is to be controlled, and the code "points" to the channel that is to do the controlling. Let's take the Poser ball prop as an example. To have yrot react to xtran, you would use this code in the yrot channel:

           rotateY <span style="color:#ff0000;">yrot
</span>                 {
                        name GetStringRes(1028,10)
                        initValue 0
                        hidden 0
                        forceLimits 0
                        min -100000
                        max 100000
                        trackingScale 1
                        keys
                                {
                                static  0
                                k  0  0
                                }
<span style="color:#00ff00;">                  interpStyleLocked 0
                        valueOpDeltaAdd
                                _NO_FIG_
                                ball_1
                                <span style="color:#ff0000;">xtran
</span>                         deltaAddDelta 360.000000
</span>                 } 

This stuff is called ERC, and the code block which does it is called "slaving code". The deltaAddDelta line determines the strength of the slaving. In the above example "deltaAddDelta 360.000000" means that the prop will do one full rotation for every poser unit travelled. To increase the rate of spin, increase the deltaAddDelta value.


lesbentley ( ) posted Tue, 15 February 2011 at 1:27 PM

The new !"£$%^& Reply box puts double line spacing in my code. It should be single spaced. :cursing:


lesbentley ( ) posted Tue, 15 February 2011 at 1:37 PM · edited Tue, 15 February 2011 at 1:39 PM

Quote - ...and rotates by the correct amount (rotation = distance_travelled/Radius)?

I don't know the formula to work this out, but I would like to. I think it would involve Pi. I hope it involves apple Pi, because that is my favourite kind, I never was much good at math, but I'm good at eating.  :blink:


shuy ( ) posted Tue, 15 February 2011 at 2:16 PM

I think that you can create figure (ball) with one bone. Then load any prop and "point at". Then you can treat prop as a pivot.


lesbentley ( ) posted Tue, 15 February 2011 at 4:59 PM

For a Poser ball prop, scaled at 100% the correct deltaAddDelta ratio seems to be:

deltaAddDelta 1130.973354

At this value the ball seems to stay in contact with the ground without skidding.


Miss Nancy ( ) posted Tue, 15 February 2011 at 5:12 PM

file_465542.gif

 

like the above? at x=0, zrot=0 . at x=pi*d, zrot=-360.



acrionx ( ) posted Wed, 16 February 2011 at 1:09 AM · edited Wed, 16 February 2011 at 1:10 AM

Quote - > Quote - ...and rotates by the correct amount (rotation = distance_travelled/Radius)?

I don't know the formula to work this out, but I would like to. I think it would involve Pi. I hope it involves apple Pi, because that is my favourite kind, I never was much good at math, but I'm good at eating.  :blink:

 

Lol.  Let's say if the ball rotates 360 degrees, then the distance travelled is the circumference of the ball. 

circumference = 2piRadius

The 2pi is the rotation in radians.  So 2pi radians=360 degrees.

So solving for the rotation, you get 2*pi = circumference / Radius

www.acrionx.com | My Freebies | My Store | My Youtube Channel


acrionx ( ) posted Wed, 16 February 2011 at 1:23 AM · edited Wed, 16 February 2011 at 1:33 AM

Quote -  like the above? at x=0, zrot=0 . at x=pi*d, zrot=-360.

 

Yes, exactly.  Here is a simple wheel and axle figure I made to try out the codes with.  It worked! . . .  Well, sort of.   It only works correctly when moving toward the positive x and y directions.   Once you unzip to your Runtime directory, the figure can be found in the Acrionx->WheelAxle folder.

I have this in the .cr2 file for the wheel's rotation: rotateZ zrot { name zrot initValue 0 hidden 0 forceLimits 0 min -360000 max 360000 trackingScale 1 keys { static 0 k 0 0 } interpStyleLocked 0 valueOpDeltaAdd Figure 1 Axle:1 xtran deltaAddDelta -360.000000 } rotateZ zrot { name zrot initValue 0 hidden 0 forceLimits 0 min -360000 max 360000 trackingScale 1 keys { static 0 k 0 0 } interpStyleLocked 0 valueOpDeltaAdd Figure 1 Axle:1 ztran deltaAddDelta 360.000000 }

www.acrionx.com | My Freebies | My Store | My Youtube Channel


Miss Nancy ( ) posted Wed, 16 February 2011 at 3:41 PM

file_465582.png

the other way is to make z-rot or y-rot a dependent parameter of xtrans (poser 8 and later).  no text editing needed.



Miss Nancy ( ) posted Wed, 16 February 2011 at 5:26 PM

file_465584.png

 

the text as abv.



Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.