• All submissions to this site are governed by Second Life Project Contribution Agreement. By submitting patches and other information using this site, you acknowledge that you have read, understood, and agreed to those terms.
Issue Details (XML | Word | Printable)

Key: VWR-332
Type: Bug Bug
Status: Reopened Reopened
Priority: Normal Normal
Assignee: Unassigned
Reporter: Ziggy Puff
Votes: 8
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
1. Second Life Viewer - VWR

LSL translate and rotate interpolate at different rates (Was: Scripted prim movement rendered differently when object is selected)

Created: 29/Mar/07 01:46 PM   Updated: 27/Dec/08 09:57 AM
Return to search
Component/s: Graphics
Affects Version/s: First Look: Render Pipeline, 1.14.0.x, 1.15.0.x, 1.16.0.x, 1.21, 1.22 Release Candidate
Fix Version/s: None

File Attachments: None
Image Attachments:

1. repro1.jpg
(45 kB)

2. repro2.jpg
(11 kB)
Issue Links:
Relates
 

Linden Lab Issue ID: SL-51792


 Description  « Hide
When a prim changes its position and rotation in a single llSetPrimitiveParams call, the damping applied to the two changes is different. This makes the prim jerk around, instead of smoothly moving to the new position/rotation together. To reproduce:

Create a box prim of size <1.0, 0.5, 2.0>. Make sure the rotation is 0. Color this prim red.
Create a sphere of the default size. Make sure the rotation is 0.
Link them so the box is the child prim, and it has the bottom left edge at the sphere's center (see attached images)

Drop this script into the child (box) prim:

default
{
state_entry()

{ llSetTimerEvent(3); }

timer()

{ vector scale = llGetScale(); rotation newLocalRot = llGetLocalRot() * llAxisAngle2Rot(<1, 0, 0>, PI / 16.0); vector newLocalPos = scale * newLocalRot / 2.0; newLocalPos.x = 0; llSetPrimitiveParams([PRIM_POSITION, newLocalPos, PRIM_ROTATION, newLocalRot]); }

}

This will make the prim turn around its edge. Zoom in on the center of the sphere, so you can watch the 'hinge' edge of the prim as it turns.

Observations:

  • If the prim is selected, the movement is completely undamped (this is expected). The 'hinge edge' of the prim never moves, and the box prim turns cleanly around the sphere.
  • If the prim isn't selected, the position change happens slower than the rotation change. The 'hinge edge' of the box prim visibly jerks around - it moves away as the rotation is applied first, then moves back when the position change is applied.


 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Ziggy Puff added a comment - 29/Mar/07 11:48 PM
Spent some more time looking at this. It seems like the viewer tries to render the prim movement smoothly? I see two issues. One is what I already reported - the smoothing doesn't happen if the prim is selected. However, for me, there is a bigger issue - the degree of smoothing applied is different for rotations vs. translations - translations look slower than rotations. If an llSetPrimitiveParams() call is made with both position and rotation parameters, the prim moves to the new rotation a little bit before it moves to the new position. This makes it visibly jerk, especially if the prim is long and fairly flexi.

The script I'm using calculates a new position/rotation to make the prim rotate around its endpoint. Prior to the update, this looked perfect. Now, the prim movement is jerky. And as reported initially, this only happens if the object isn't selected. If the object is selected in the edit window, both the movement and the rotation look like they happen instantaneously. So in my case the prim snaps into place, but the visual effect is what I'd expect if the prim were rotating around its endpoint.

So... I'm guessing that someone 'slowed down' non-physical movement, in order to make it look nicer/smoother? It does look good, but I'm guessing the timing for that is different for rotation changes. I think they should be smoothed the same amount, so that when the two are applied together using the set primitive params call, the effect looks right. Right now the prim kinda jerks/slides into its new position/rotation.


Khamon Fate added a comment - 05/Apr/07 01:33 PM
This may be the same bug causing prims that are moved using llSetPrimitiveParams(). In my case, it only occurs when the prims are flexible.

Ziggy Puff added a comment - 27/Apr/07 02:29 PM
I found this issue when using llSetPrimitiveParams, like you said. The script above was my attempt to reduce this to the simplest script that will show the problem. A prim rotation looks different if the object is left in-world, vs. when it is selected. I thought this was a rendering issue in the viewer, but it could be related to how the server sends out the updates.

Kala Bijoux added a comment - 01/May/07 11:35 AM
When llSetPrimitiveParams() is used on a flexible child prim to set position and rotation in the same call, the two settings are not applied together. The rotation change takes effect quickly, while the position change happens 'smoothly', and more slowly. This causes the prim to visibly 'jerk', because it snaps to the new rotation and then smoothly moves to the new position, instead of moving to the new position and rotation together. This is very noticeable with long thin prims like wing feathers. It is more noticeable in a sky box than on the ground.

If the object is selected (with a right-click or in the Edit menu), the rotation and position changes are applied together, and the prim movement looks smooth. If the prim is non-flexi, that seems to help the problem too.


Ziggy Puff added a comment - 27/May/07 01:39 PM
This is still broken in 1.16.

Argent Stonecutter added a comment - 04/Jun/07 10:30 AM
I'm not sure that a selected prim should be able to set its rotation, or position, any more than a selected physical prim gets to keep moving.

Daniel Millgrove added a comment - 04/Jun/07 12:57 PM
I reported about this issue in the forums already in mid-february.
http://forums.secondlife.com/showthread.php?p=1410667#post1410667
I am rather upset that not only I got ignored, but even experienced scripter with in-depth know how pointing to the problem and giving easily reproducable testcases...

Ziggy Puff added a comment - 05/Jun/07 08:57 AM
Argent, you're right, I got 2 issues mixed up in this bug report. The selected/unselected difference is the expected behavior, I understand that now. There's still an issue with how the viewer damps position and rotation changes on non-physical objects. From Daniel's post, it looks like he's talking about the same thing.

Pasting from an email, so we have a paper trail here:

!!~

You're right, I got 2 issues mixed up in that bug report. OK, so no interpolation/damping when an object is selected - that's expected behavior, I understand that. I'm more concerned with the second issue.

Think of a long flat flexi rectangle that's a wing feather. When the wing flaps, the prim needs to move around its flexi anchor point. This is non-physical movement, and I'm using llSetPrimitiveParams to set the position/rotation together (with values calculated to make it look like the prim rotated around its endpoint). As far as I could tell (from eyeballing the movement in an empty sim), the interpolation/damping applied by the client is different for rotation vs. translation. I can see the prim 'slide into' its final position/rotation, but it reaches the target rotation before it reaches the target position. It was hard to tell if the position change was damped and the rotation change was undamped, or if the two were damped but by different amounts. The difference is more visible when framerates are higher. This makes the prim jerk, because you see the rotation applied around the prim center, followed by the prim moving to its new position. So instead of looking like the prim turned around its anchor endpoint (so the anchor endpoint shouldn't move), what you see is a prim rotate around its center (which moves the anchor endpoint in the wrong direction), followed by a position change (which moves the anchor endpoint back to where it needs to be).

So I don't think it's a lag issue - the new position/rotation should both come to the client in the same update message, right. I think it's an issue with how the client smooths the movement. The visual effect of the smoothing applied to the position change is different from the smoothing applied to the rotation change. And this behavior changed when the first-look code was integrated into the main viewer, and has been this way since then.

I was playing around with updateXform and updateDrawable last night. If I turn off damped motion completely, my wings go back to the way they used to work. But that's probably not a viable solution, and I didn't see what that did to physics and llTargetOmega. But at least it tells me I'm in the right area of the code. I'll play with changing the interpolation for rotation vs. position changes to try and understand this better.

!!~

I got this confused with the selected/edited issue, because when a prim is selected, all movement is undamped, and that makes the rotation/position changes happen together. When the prim is unselected, the two are happening at different times/speeds. I like the visual effect of the damped position change, and I think the rotation change should also be damped over the same time duration.

I'm more than happy to meet someone in-world to demonstrate this.


Ziggy Puff added a comment - 05/Jun/07 09:41 AM
Editing the description to describe a better way to reproduce this. The original description combined two separate issues, one of which is expected behavior.

Soft Linden added a comment - 13/Aug/07 03:34 PM
[15:33] WarKirby Magojiro: the second one beinfg that rotations and translations are interpolated at different rates

Rob Linden added a comment - 13/Aug/07 06:11 PM
Notes from triage

[15:30] SignpostMarv Martin: 332, still borked
[15:30] Solomon Draken: Yep
[15:30] SignpostMarv Martin: as indicated by that ply ball I sent Soft and Rob
[15:30] WarKirby Magojiro: I don't see how this is a bug
[15:30] WarKirby Magojiro: it's the behaviour I'd expect
[15:30] WarKirby Magojiro: much in the same way as llTargetOmega pauses when you select something
[15:30] Soft Linden: A quick note: The JIRAs for a meeting are set ahead of time, based on age in the public JIRA, or the number of votes on issues.
[15:30] SignpostMarv Martin: default{state_entry(){llCollisionSprite("7b4cb379-38c1-034b-0cdd-e32dca97bf5d");llCollisionSound("f3941b66-b74b-fe19-f67f-1e371f77eac0",10.0); }}
[15:31] Soft Linden: If ya want something brought up in the meeting, the 100% best way is to get friends to vote a pet issue up.
[15:31] SignpostMarv Martin: the sound works but the particles don't
[15:31] Soft Linden: The more streamlined we can keep these meetings, the more issues we can get imported for developers to see.
[15:31] Rob Linden: is VWR-332 major priority?
[15:31] SignpostMarv Martin: meh
[15:32] SignpostMarv Martin: a workaround as mentioned would be to use llParticleSystem() in collision_start()
[15:32] SignpostMarv Martin: so I wouldn't call it major
[15:32] Rob Linden: k....marking normal, then import
[15:32] WarKirby Magojiro: 332 is two issues
[15:32] Jacek Antonelli: Wait, wait, are we talking about 322 or 332?
[15:32] WarKirby Magojiro: one of which is really a non issue
[15:32] Rob Linden: 332
[15:33] WarKirby Magojiro: the other is worth fixing, I think
[15:33] Jacek Antonelli: 332 isn't the particles one
[15:33] Solomon Draken: Yes
[15:33] Solomon Draken: It can be rather annoying
[15:33] Saijanai Kuhn: was going to sy the new one hs nothing to do with collisions
[15:33] SignpostMarv Martin: lol
[15:33] WarKirby Magojiro: the second one beinfg that rotations and translations are interpolated at different rates
[15:33] SignpostMarv Martin: numbers are too similar
[15:33] Jacek Antonelli: aye
[15:33] Soft Linden: Ya, it would make sense for those to be similar/identical.
[15:34] WarKirby Magojiro: I think that part of the issue is worth looking at, then
[15:34] Soft Linden: I'll add a comment to the pjira making that more explicit
[15:34] WarKirby Magojiro: the first part is expected behaviour, though, and needs no change imo
[15:34] Wyn Galbraith: Lag test.
[15:35] Rob Linden: anyone object to making VWR-332 normal, and then import?
[15:35] Rob Linden: if not, moving on


Ziggy Puff added a comment - 28/Aug/07 10:43 AM
Thanks for updating the title, and apologies for not doing it myself to make things clearer. I started out with two issues mixed up, and one of them turned out to be a non-issue, and the comments got kinda hard to follow. I re-wrote the main description to be a repro for the translation/rotation interpolation issue, but didn't update the title.

meni kaiousei added a comment - 27/Dec/08 08:56 AM
This issue lists an outdated viewer as the affected version. Can you update the "Affects Version/s" if this is still an issue for you for the latest viewers?

Ziggy Puff added a comment - 27/Dec/08 09:57 AM
I still see the exact same behavior with 1.21.6 and 1.22.4

Ziggy Puff added a comment - 27/Dec/08 09:57 AM
Re-opening after adding the requested information.