how to make a resizable Object ?

Typically: "How do I... ", "How can I... " questions
Post Reply
jianye
Posts: 46
Joined: 16 Oct 2019, 13:58

how to make a resizable Object ?

Post by jianye »

Hi guys,

I'm new to Vrep and I want to use Vrep to build a resizable light curtain. like this https://4.imimg.com/data4/RU/TC/ANDROID ... 0x500.jpeg

I have already build a Object but I do not have idea to make it resizable(with a ui to resize the height length and width).

has anyone a similiar modell ? or similiar script code?

thank you

jian

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

Re: how to make a resizable Object ?

Post by coppelia »

Hello Jian,

have a look at some of the resizable models that ship with V-REP, for instance Models/robots/non-mobile/ragnar.ttt.
But basically you can resize an object with sim.scaleObject. You can find out about an object's bounding box size with sim.getObjectFloatParameter(objectHandle,x), where x is an argument of type sim.objfloatparam_objbbox_min_x, sim.objfloatparam_objbbox_max_x, sim.objfloatparam_objbbox_min_y, etc.

But beware, some objects, and also some types of shapes can only be isometrically resized.

Finally, you will have to use custom UIs to create dialogs that allow you to interact with the created model. Have also a look at the demo scene scenes/customUI.ttt

Cheers

Post Reply