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.

Matthew Gillespie avatar image Matthew Gillespie ♦♦ commented ·

This is very similar to this other idea.

0 Likes 0 ·
Ben Wilson avatar image Ben Wilson ♦♦ commented ·

As mentioned in the post @Matthew Gillespie linked, there is the Cams Module, which doesn't do exactly what you're asking, but is along the same lines.

Direct link to latest Cams module.

0 Likes 0 ·
Chris Smith avatar image Chris Smith commented ·

Thanks, that is the same request... Sorry to create a duplicate idea. I am unsure why, but I tried to search for a similar idea using camera, view, and follow, but that other post didn't show up (until the recent comment was added). I just realized that my search results in answers is just showing the last days posts, but I have the anytime filter on the search. Is that just me?

0 Likes 0 ·
Ben Wilson avatar image Ben Wilson ♦♦ Chris Smith commented ·

Thanks for the heads up.

The site was having some issues, so AnswerHub, the provider for this forum, rebuilt the site on Friday. It appears that searches are only looking at content since the rebuild.

We'll see what we can do to re-index the entire site.

0 Likes 0 ·

2 Comments

·
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.

Write a Comment

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.