ATTENTIONThis 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 |
#1
|
|||
|
|||
vectorprojectx
Hello,
I am reading the documentation on vectorprojectx. ------------------------------------------------ vectorprojectx(obj projectfrom, num fromx, num fromy, num fromz, obj projectonto) Description: Takes the location vector (fromx, fromy, fromz) in projectfrom's coordinate space, translates this vector onto projectonto's coordinate space, and returns the x value of the projection. Example: vectorprojectx(current, 0,1,0, model()); This example finds out the global x location of the location (0, 1, 0) in current's coordinate space. --------------------------------------------------- I am wondering what projectfrom and projectonto coordinate space is? any further explanation would be appreciated. Best, |
#2
|
||||
|
||||
This functions perform the matrix calculations of the position vectors to find out what the position in a axis system is in a different axis system. (remember your math in university)
So when looking at the example, if you have an object (in the example this is the "current") and you have a position of 0,1,0 (meaning 0 in x, 1 in y and 0 in z) in the axis system of this object, what position is that exactly in the model's axis system. So if your object is not rotated, this is quite simple. It is the x,y position of the current + 0,1 , but if the current is rotated, this becomes more complex and the vectorproject functions help you with that. |