Dynamic scaling

Typically: "How do I... ", "How can I... " questions
Post Reply
Leizah
Posts: 61
Joined: 20 Jun 2021, 16:47

Dynamic scaling

Post by Leizah »

Hi,
I got a scene made up of a Bill on path model and a cylindrical primitive shape placed on the floor.

I already set a code that shows me when the two elements collide, but I would like to set the following condition:

If Bill enters the cylinder, the cylinder radius r has to reduce of 50%.

I had problem finding a condition that allows this dynamic scaling to happen (If the cylinder radius reduces of 50% then Bill is no more inside it, so this solution doesn't work).

I also thought that I'd making two different concentrical cylinders with different values of radius and to set the logical condition that, when Bill enters the external one, only the internal one is showed.
Unfortunately, I didn't find a way to "hide" the external one when the condition triggers.
There is a way to achieve that/a different way to get the reduction that I want?

coppelia
Site Admin
Posts: 8986
Joined: 14 Dec 2012, 00:25

Re: Dynamic scaling

Post by coppelia »

Hello,

you can hide an object by setting its visibility layer to zero, e.g.:

Code: Select all

sim.setObjectInt32Param(objectHandle,sim.objintparam_visibility_layer,0)
note: you might have to use sim.setObjectInt32Parameter instead, if your version is not up-to-date.

Cheers

Leizah
Posts: 61
Joined: 20 Jun 2021, 16:47

Re: Dynamic scaling

Post by Leizah »

Thank you, it works just as I wanted!

Cheers

Post Reply