Idea

Chris Smith avatar image
4 Likes"
Chris Smith suggested Jacob Gillespie commented

An option to have a view follow an object

Another idea... This one was actually suggested by a colleague of mine, and I thought it was already in the software, but am unable to find it. If it already exists, then I am sorry, but please remind me of how to get to it.

The idea is to allow a 3D view to be attached/follow an object in the model. For instance, a sampler could be used to select an object that the view will follow. I am currently doing this with the following code on the views preDraw code (it does have some issues). There is a global variable that is trackedItem that is a reference to the object to track.

The code:

treenode movingView = c; if (objectexists(trackedItem)==1 && objectexists(movingView)==1) { Object theItem = trackedItem; movingView.find(">viewsettings/viewpointx").value = theItem.location.project(theItem,model()).x; movingView.find(">viewsettings/viewpointy").value = theItem.location.project(theItem,model()).y; movingView.find(">viewsettings/viewpointz").value = theItem.location.project(theItem,model()).z; } else { movingView.find(">viewsettings/viewpointz").value=0; }

Additionally it would be cool to not just follow in the x,y,z, but have the camera located from the objects perspective as it moves through the model.

3d viewview settingscamera view
· 4
5 |100000

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

Jacob Gillespie avatar image
1 Like"
Jacob Gillespie commented

This feature will be available in the upcoming FlexSim 17.2.

5 |100000

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

Cody Barniak avatar image
0 Likes"
Cody Barniak commented

Hi Chris, where do you enter this code? I want to attach the camera view to follow a moving forklift (and other objects) in order to make a video of my model. Any suggestions or pointers would be helpful. Thx Cody.

5 |100000

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

Your Opinion Counts

Share your great idea, or help out by voting for other people's ideas.