question

Pedro Ortelani avatar image
2 Likes"
Pedro Ortelani asked Pedro Ortelani commented

Module SDK - 3d Shape Manipulation via code

Hello,

I want to make a 3d shape that alters itself depending on the object's size, just like the conveyor does when I rise its length. What would be the right way to accomplish this?

The way I am currently thinking would be drawing the 3d object parts with some modeling software, like Blender. And them use some graphic library (like openGL) that would read those objects and create the "complete" version taking its size in consideration.

The problem with this way is that it could get to a degree of complexity not intended. Is there an easier way?

Thanks.

FlexSim 20.0.3
module sdk3d shape
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Pedro Ortelani avatar image Pedro Ortelani commented ·

The problem I am having is that as i stretch its axis X length, the 3d object gets deformed, I want it to adjust itself to the new size.

1 Like 1 ·

1 Answer

Matthew Gillespie avatar image
1 Like"
Matthew Gillespie answered Pedro Ortelani commented
· 9
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Pedro Ortelani avatar image Pedro Ortelani commented ·

I'll take a look at it, thanks.

1 Like 1 ·
Pedro Ortelani avatar image Pedro Ortelani commented ·

Looking into the model I get that it draws the 3d object inside FlexSim using only the Mesh API, with its position and color information.

So what I should be doing is just drawing the 3d direct from flexscript? And not use a .3ds file? (For 3d objects that can have its size modified).

1 Like 1 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ Pedro Ortelani commented ·

We draw our own meshes for objects in FlexSim that update their shape based on their size like conveyors, the waiting line, racks, etc.

It's not very easy, but it does let you adjust the shape dynamically.

0 Likes 0 ·
Pedro Ortelani avatar image Pedro Ortelani Matthew Gillespie ♦♦ commented ·

Got it, not very easy indeed, but I'll try it!

Thanks for the help!

1 Like 1 ·
Pedro Ortelani avatar image Pedro Ortelani commented ·

@Matthew Gillespie,

Just one more piece of advice please!

I am trying to use the meshsetvertexattrib method with C++ on my dll, but it calls for a fourth parameter, the example only uses 3 (px, py and pz), is there a way for me to ignore the fourth parameter? What value should i put in it?

I can't make the Mesh API example worth through C++, and i believe this fourth parameter may be the issue.

Thanks!

1 Like 1 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ Pedro Ortelani commented ·

The flexscript command just sets the fourth parameter to 0 if you don't pass anything in. So I would just pass 0 for the fourth parameter.

1 Like 1 ·
Pedro Ortelani avatar image Pedro Ortelani Matthew Gillespie ♦♦ commented ·

Ok, thanks!

1 Like 1 ·
Show more comments