ATTENTION

This FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices.


flexsim.com

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
Downloads

Q&A Using Flexsim and building models

  #1  
Old 11-30-2009
Steven Hamoen's Avatar
Steven Hamoen Steven Hamoen is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Location: Soest, NL
Posts: 854
Downloads: 43
Uploads: 0
Thanks: 391
Thanked 661 Times in 379 Posts
Rep Power: 684
Steven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond repute
Default Moving around objects on high Z-position

If you have objects that are at a certain level (e.g. 10 mtr above ground level) and you are trying to move around the object, the problem is that the moving is relative to a rotation point at the floor. So if you are closeby and you rotate the object, the object is rotate out of view straight away.

So I figured that I can use the viewpointz to change the viewpoint but that doesn't seem to work. Whatever value I enter nothing happens. Is this a bug?

I also tried the first person option on the view menu, but that doesn't help much either.

I attached a simple model. Try to zoom in on the queues above the conveyor and then try to rotate around it and it shows what I mean.

Are there any other suggestions?

Maybe as an extra, I just tried to work with 4 views like in AC3d so look at my model from 3 different planes and a normal ortho view, but doesn't work either because the z-plane always stays in the middle of the view. (besides some other weird reaction when moving objects around in a plane but that could be solved with adapting the ortho view)
Attached Files
File Type: zip HighQueue.zip (70.5 KB, 292 views)
  #2  
Old 11-30-2009
Anthony Johnson's Avatar
Anthony Johnson Anthony Johnson is offline
Manager of Product Development
 
Join Date: Jul 2007
Posts: 440
Downloads: 86
Uploads: 4
Thanks: 171
Thanked 899 Times in 288 Posts
Rep Power: 735
Anthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond repute
Default

Yeah, I've seen this issue as well. Yes, technically, it's a bug, although it's kind of "by design." I think we just never got around to implementing the viewpoint offset in the z, and it hasn't really come up until now.
  #3  
Old 11-30-2009
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

If you put this in an OnPreDraw node in the view attributes tree it will keep an object (selected as so() here or whatever you set as objfocus) in the center of the view regardless of its size and elevation:

Code:
treenode objfocus=so();
if (objectexists(objfocus)){
    double vrx=maxof(-179,minof(-0.5,get(viewpointrx(c))));
    double vrz=get(viewpointrz(c));
    double alpha=degreestoradians(vrx);
    double b=degreestoradians(vrz);
    double z= zloc(objfocus)+zsize(objfocus)/2.0;
    double x=xloc(objfocus)+xsize(objfocus)/2.0;
    double y=yloc(objfocus)-ysize(objfocus)/2.0;
    double tanval=tan(alpha);
    if (!get(viewfirstperson(c))&&tanval!=0){
       x=x+sin(b)*z/tanval;
       y=y-cos(b)*z/tanval;
       z=get(viewpointradius(c));
   }
   setcameradirection(c,x,y,z,vrx,0,vrz);
}
You'll need to add vectorproject functions if the object is contained in other objects.

Last edited by Jason Lightfoot; 11-30-2009 at 04:24 PM. Reason: Updated to account for firstperson view mode
The Following 4 Users Say Thank You to Jason Lightfoot For This Useful Post:
Tom David (12-01-2009)
  #4  
Old 12-01-2009
Steven Hamoen's Avatar
Steven Hamoen Steven Hamoen is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Location: Soest, NL
Posts: 854
Downloads: 43
Uploads: 0
Thanks: 391
Thanked 661 Times in 379 Posts
Rep Power: 684
Steven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond repute
Default

@Anthony:

Will you put it on the list for version 5.0 ? Or do I have to mail to development for an official request?

@Jason:

You are KING! Thank you, this is really nice, I have to take a good look at the angles and I think that I can use the highlighted object instead of so() and then it is a very nice improvement
  #5  
Old 12-01-2009
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default Model example

Steven,

In this model you can hold 'T' (for Target?) and left-click an object to set the rotatefocus. Clicking the left mouse button again will clear the focus allowing you to pan as usual.

I've also added the library for auto installing this to the DefaultGUIs folder.
Attached Files
File Type: zip RotateFocus.zip (89.0 KB, 264 views)
File Type: zip TargetLockGUIs.zip (20.5 KB, 246 views)

Last edited by Jason Lightfoot; 12-01-2009 at 07:31 AM.
The Following 3 Users Say Thank You to Jason Lightfoot For This Useful Post:
Tom David (12-01-2009)
  #6  
Old 12-01-2009
Anthony Johnson's Avatar
Anthony Johnson Anthony Johnson is offline
Manager of Product Development
 
Join Date: Jul 2007
Posts: 440
Downloads: 86
Uploads: 4
Thanks: 171
Thanked 899 Times in 288 Posts
Rep Power: 735
Anthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond repute
Default

Steven,
Yeah, I'll put it on the dev list.
  #7  
Old 12-01-2009
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default Update #1

Added the vectorproject functions. Clicking 'T' on flowitems follows them through the system and allows you to change rotation and zoom.
Attached Files
File Type: zip TargetLockGUIs.zip (19.6 KB, 241 views)
The Following 2 Users Say Thank You to Jason Lightfoot For This Useful Post:
Tom David (12-01-2009)
  #8  
Old 12-01-2009
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default Update #2

Chosen to lock the 'focus distance' in the perpective view when the object is clicked with 'T' pressed. This now prevents the view from zooming into the object at certain angles.
Attached Files
File Type: zip TargetLockGUIs.zip (20.4 KB, 238 views)
The Following 3 Users Say Thank You to Jason Lightfoot For This Useful Post:
Tom David (12-02-2009)
  #9  
Old 12-02-2009
Steven Hamoen's Avatar
Steven Hamoen Steven Hamoen is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Location: Soest, NL
Posts: 854
Downloads: 43
Uploads: 0
Thanks: 391
Thanked 661 Times in 379 Posts
Rep Power: 684
Steven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond repute
Default

Jason,

I don't exactly understand why you create this "DefaultGUIs" node and put the 2 views in there. Is that a special flexsim node that you can use?

I was planning to let your gui's simply overwrite the standard GUI's and r so that way when ever you open a new ortho or perspective they automatically have this functionality.

Steven
  #10  
Old 12-02-2009
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default DefaultGUIs

The DefaultGUIs node found in /Tools is where the default settings are stored when you right click a perspective or othographic view and choose 'view->set as default'. If the GUIs exist there, Flexsim opens those rather than the standard views defined in the views library.

If you unload the library and then hit 'new model', or open a model without these set as default, then the normal views are restored - which is the main difference in doing it this way I think.

Or have I misunderstood and there's an easier way to get them installed?
The Following 4 Users Say Thank You to Jason Lightfoot For This Useful Post:
Tom David (12-02-2009)
  #11  
Old 05-14-2013
KvThiel KvThiel is offline
Flexsim User
 
Join Date: Jan 2013
Posts: 12
Downloads: 3
Uploads: 0
Thanks: 2
Thanked 0 Times in 0 Posts
Rep Power: 89
KvThiel is on a distinguished road
Default Camera viewpoint

Hi,

Instead having a view that is focused on an object with an objectfocus point, I would like to see the view in the other direction, like a camera. I would like to develop an object (camera) coupled to an perspective/ortho view. If the object moves the view has to move instantly.

Does any one have already a suggestion how I could do this?

I'm know collecting all codes from the forum to see if I can merge and adjust these codes to get it work. But maybe there are already solutions to do this.

Kind regards,

KvThiel
  #12  
Old 05-14-2013
Carsten Seehafer's Avatar
Carsten Seehafer Carsten Seehafer is offline
FlexSim Geek
 
Join Date: Oct 2008
Location: Ritterhude, Deutschland
Posts: 230
Downloads: 45
Uploads: 1
Thanks: 474
Thanked 320 Times in 143 Posts
Rep Power: 379
Carsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud of
Default

Hi,

please set your view in "more view settings" to "1st person view". You can also change the variables viewpointx, viewpointy, viewpointz, viewpointrx, viewpointry and viewpointrz of persp view in OnDraw-trigger of your moving object.

Greetings,

Carsten
The Following 3 Users Say Thank You to Carsten Seehafer For This Useful Post:
Sebastian Hemmann (05-14-2013)
  #13  
Old 09-02-2013
David Chan David Chan is offline
Flexsim Distributor
 
Join Date: Sep 2007
Posts: 326
Downloads: 74
Uploads: 0
Thanks: 217
Thanked 73 Times in 44 Posts
Rep Power: 218
David Chan has a spectacular aura aboutDavid Chan has a spectacular aura aboutDavid Chan has a spectacular aura about
Default

Carsten

Good day to you.

Is the following statement correct for changing the viewpointx of perspective to the view of the current object?

setnodenum(node("/standardviews/perspective>viewpointx",views()),getnodenum(viewpo intx(current)));

David
__________________
Advent2 Labs
David
  #14  
Old 09-02-2013
Carsten Seehafer's Avatar
Carsten Seehafer Carsten Seehafer is offline
FlexSim Geek
 
Join Date: Oct 2008
Location: Ritterhude, Deutschland
Posts: 230
Downloads: 45
Uploads: 1
Thanks: 474
Thanked 320 Times in 143 Posts
Rep Power: 379
Carsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud of
Default

If current is your moving object it should be something like this:

setnodenum(node("/active/persp>viewpointx", views()), xloc(current));

This code changes the x-coordinate of viewpoint in the active perspective view.

Greetings

Carsten
The Following User Says Thank You to Carsten Seehafer For This Useful Post:
David Chan (09-02-2013)

Tags
rotate, viewpointz, z-position


Thread Thread Starter Forum Replies Last Post
Moving Conveyor Brandon Peterson User Development 5 07-30-2009 06:53 PM
change the objects in self modeled objects Manuel Kraenzle Q&A 7 10-27-2008 02:29 PM
Output high volume data Liu Bin Q&A 8 06-16-2008 09:18 AM
Operators moving backwards Nico Zahn Tips and Tricks 0 05-19-2008 04:51 AM
Moving Network Node Information into a Table Brandon Peterson Q&A 2 02-15-2008 09:46 AM


All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.