Jump to content

How to move root prim without moving others


animats
 Share

You are about to reply to a thread that has been inactive for 2095 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

How can I move the root prim of a linkset without moving all the others?

llSetLinkPrimitiveParams(LINK_ROOT,[PRIM_POSITION, pos]) moves the whole linkset, which is documented in the notes.

llSetLinkPrimitiveParams(LINK_THIS,[PRIM_POS_LOCAL pos]) moves the whole linkset.

Link to comment
Share on other sites

You either 

1. Move the root prim and then move all the child prims back to where they were before, or

2. Redesign the linkset, making a different prim the root, and then move it.

Either way is a bit of work, but unless there's a good design reason to keep that prim as the root, I would opt for solution #2.

Link to comment
Share on other sites

Does setting PRIM_POSITION work on child prims at all? PRIM_POS_LOCAL does, but PRIM_POSITION doesn't seem to do anything.

I ended up with approach #2.

What I'm writing is a turntable for picture-taking. You set some object on it, and the turntable rotates it. Scripts are in the turntable. I have a setup working which finds an object above the turntable and links it to the turntable, centers the object on the turntable, rotates the turntable to get various angles, and finally unlinks the object without damaging it. Of course, I have to have object ownership and mod permissions to do this. Also, since it's moving all the prims individually, it introduces small positional errors due to floating point roundoff.

It works, but it's clunky. Any better ideas, or is that as good as it gets?

Link to comment
Share on other sites

7 hours ago, Wulfie Reanimator said:

Out of curiosity, is there a reason for the linking/unlinking besides novelty?

How else can I position an object without putting a script in it? There's no llSetObjectDetails; that would be too dangerous.

Link to comment
Share on other sites

13 minutes ago, animats said:

putting a script in it

This is why I'm asking. Wouldn't it be more practical to put a script in the object itself? Unless the turntable is some kind of a stand for a general object/shape I guess.

Again, this is just for my own curiosity as to the why. I think Rolig already covered all the possible things you can do about the positioning.

Link to comment
Share on other sites

3 hours ago, Wulfie Reanimator said:

Unless the turntable is some kind of a stand for a general object/shape I guess.

Yes. That's the idea. I'm building a setup to take pictures of objects for billboard imposter models for a low-LOD experiment. You put something on the turntable, and it's centered and rotated through a set of standard rotations while pictures are taken. (I wish I could trigger the viewer's picture-taker automatically, but no.) It's a proof of concept to see how far away you have to get before a billboard impostor looks OK in SL.

You can do all this by hand, but it's a pain to get everything lined up right. I'm putting some automation on the process, so we can try lots of objects - furniture, vehicles, knick-knacks - and see what looks good. I want a rig where you put an object on the turntable, sit in a chair, and click "Take picture" and "Advance to next rotation"  to take the pictures. There's a green screen involved, so the object's background is removed. chairs1.png.428ca18200b762df1ab3e1e7c20ae06c.png

Centered and rotating For picture taking, there would be more green screens and the viewpoint would be level with the root of the object.

Edited by animats
Grammar.
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • 2 weeks later...

I've made a bit more progress on this. Here's the setup:

impostorsetup_001.thumb.jpg.37752a8878870864647d92be4c0ad10a.jpg

Setup for taking impostor pictures. The avatar sits on the box at the left, and looks at the object on the turntable in front of the green screen.

The green screen is a prim that's a solid color and full bright. It's backed up by a solid black prim which is not full bright. That keeps glow from seeping through the full-bright prim, which glow will do.

The object on the turntable is rotated through 45 degree increments every few seconds, and a beep sounds after each rotation. The user hits CNTL-backquote on each beep to take a picture. So this takes the set of 8 views quickly and easily.

The avatar is 25 meters back, far enough that the picture is almost an orthographic projection (infinite distance). Cameratools->View angle is used to narrow down the field of view to get a useful picture. Like this.

glow_005.thumb.jpg.d61fd1749ee4fc0870ce9e0b8787af77.jpg

Picture as taken. A clean  rectangular image.

The frame is 3m high and 6m wide, so we have a size reference. Anything bigger, and we need a larger camera rig and a bigger parcel. This is about right for furniture, cars, household objects, and such.

Next we remove the red frame and the green background and cut to size.

glow_005-clipped.png.6ef63118e1a3c51ba086a809ca10bfed.png

Green screen removed. Alpha channel for impostor use.  You wouldn't normally look at an impostor in closeup like this; it's for a low level of detail for distant objects.

That was cleaned up with a photoshop-like program. The next step, yet to be written, is a Python program that takes the images, does the clipping, green screen removal, and resizing, and makes up one texture with all 8 images. I want to make the impostor generation easy, so we can try it on different objects and see how it looks.

This is for a proof of concept for billboard imposters. I have a dummy test impostor object for displaying these. It lets us see in world what object impostors would look like. It only works for one avatar viewing it, because it's based on avatar position. Can't do this for real without viewer mods. But we can do a demo.

More to come.

 

Edited by animats
Cleanup
Link to comment
Share on other sites

16 hours ago, animats said:

This is for a proof of concept for billboard imposters. I have a dummy test impostor object for displaying these. It lets us see in world what object impostors would look like.

Sorry, I don't get it. We do billboard imposters since the introduction of Mesh imports in 2010. At least those creators who care. Those who don't care do it because of they zero out LODs to keep the land impact as low as possible, as a marketing point.

As long as this table example isn't all just a single mesh, all these individual objects will switch LODs at different distances. How would a single imposter handle that?

Edited by arton Rotaru
Link to comment
Share on other sites

1 hour ago, arton Rotaru said:

Sorry, I don't get it. We do billboard imposters since the introduction of Mesh imports in 2010. At least those creators who care. Those who don't care do it because of they zero out LODs to keep the land impact as low as possible, as a marketing point.

As long as this table example isn't all just a single mesh, all these individual objects will switch LODs at different distances. How would a single imposter handle that?

Here's a video of a 9-card impostor.  9 flat pictures and a switcher. This is the effect I'm trying to produce. I can build an in-world demo good enough to see if this looks worth doing. A real implementation would take viewer mods.

Remember, the existing system usually gives you a few random triangles as the low-LOD model, so it's not hard to beat that. You'd never get close to a real impostor and see how bad it is; it would switch to a higher-LOD first. More later on technical details.

Link to comment
Share on other sites

24 minutes ago, animats said:

Remember, the existing system usually gives you a few random triangles as the low-LOD model, so it's not hard to beat that. You'd never get close to a real impostor and see how bad it is; it would switch to a higher-LOD first. More later on technical details.

No it does not. The implementation of GLOD is only because of that there is something that creates LODs during upload. The intended process is to create LOD models outside, and use the "from file option" for LODs.

Why you see so many bad LOD models in SL has been explained to you multiple times already. It's part of the history of Second Life (look up sculpted prims).

Also, at the current implementation of Mesh in SL, you have to keep all materials present on all 4 LODs. Since SL is pretty draw call heavy already, adding another material to each and every mesh model will increase draw calls/state changes even more.

For a multitude of objects it would be much better to have just a few more triangles to work with, without increasing land impact, but keep the number of materials/textures as low as possible, rather than adding imposters to just everything.

As I said already, we do billboard imposters since 2010 already.

Link to comment
Share on other sites

11 minutes ago, arton Rotaru said:

No it does not. The implementation of GLOD is only because of that there is something that creates LODs during upload. The intended process is to create LOD models outside, and use the "from file option" for LODs.

Why you see so many bad LOD models in SL has been explained to you multiple times already. It's part of the history of Second Life (look up sculpted prims).

Wrong. Many recent mesh items also suck.

badmeshmodel1_001.jpg.aa4a819ca299a5f8c5ca717917e9deab.jpg

Typical mesh chair from Marketplace. (I'm not going to name the creator.) High-LOD model on left. Low-LOD model on right. That's the typical crap low-LOD model the uploader gives you if you don't manually create a low-LOD mesh. It just discards triangles until the triangle count gets low enough.

 

badmeshmodel1_003.jpg.35431758d2ba67a1d44be3ec67f11479.jpg

Dune buggy by one of SL's better builders. This creator does great work, and then the uploader gives him the low-LOD model on the right.

 

badmeshmodel1_004.thumb.jpg.4009689c2d4dc27ed324e687274c8b0a.jpg

A good low-LOD model. One of Chin Rey's many flowerbeds. The one on the right is lowest level of detail, a manually-built impostor of 12 triangles. It's a two-face cross impostor plus the base box. She sells many different flowerbed variations, so she has a good solution to level of detail for flowerbeds.

Yes,  many people have tried to explain this away. "It's old prim stuff". "It's old sculpty stuff." "The good creators provide hand-build low-LOD models." Despite the excuses, if you buy a mesh object on Marketplace, the odds are good it will be like the first two above. A few months back I went to a show of new mesh objects and posted how awful their low-LOD models were. The new stuff on show is not better than the old stuff.

The common work-around for this from many creators is to use high-detail models for the lower levels of detail. This looks good in isolation. Then the frame rate drops in the viewer. New users think SL sucks because of that.

I'm trying to develop a way to fix the problem, rather than just making excuses for it.

Link to comment
Share on other sites

2 minutes ago, animats said:

Wrong. Many recent mesh items also suck.

What do you think to whom you are telling this?
I said it's part of Second Lifes history. It all began with the introduction of sculpted prims. OF COURSE it evolved to mesh objects as well! This is all about having low land impact. Because low land impact has been, and still is a major selling point. More than everything else for a lot of people. Because they pay real dollars to have them items rezzed. The easy way out for many creators is to recommend to increase the RenderVolumeLODFactor, which has been common practice since sculpted prims were abused to death. The intended use case for sculpties was organic shapes like more natural looking rocks, and the like. With which the LODs of those sculpts worked quite good. But people created entire living rooms sets, and all kinds of hard surface stuff out of a single sculpted prim. There is even a palmtree group of 16 palmtrees made out of a single sculpted prim. They did this because it counts just 1 prim.

IIRC, in that thread you mention, we already posted images of models with imposters, and how they were created. But you have a tendency to just ignore such replies it seems.

If you want a whole new LOD system implemented in Second Life, I would recommend to do a feature request on the Jira. The Linden Lab Devs certainly know what billboard imposters are.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2095 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...