- This topic has 5 replies, 3 voices, and was last updated 3 years, 3 months ago by xeon.
-
AuthorPosts
-
2021-09-15 at 12:45 am #44653xeonCustomer
Just wondering if the data coming back from Get Camera Position is a Vector or a coordinate? The online manual is out of date, showing there was once an option for specifying vector or leaving it to default coordinate I believe but these options are no longer available in 3.7.1
I ask this because I had thought they were coordinates but when you calculate a line between the two sets of data from Get Camera Position…and you solve for a third… the third point is not linearly aligned…making me wonder if its vector or if I screwed up a basic algebra equation
Hoping someone can tell me unequivocally one way or another so I can either fix my formula or redo the calculation for vectors.
Thanks in advance.
Xeon
Route 66 Digital
Interactive Solutions - https://www.r66d.com
Tutorials - https://www.xeons3dlab.com2021-09-15 at 12:55 am #44654xeonCustomerTo make things even more interesting…
If you take an object and parent it to a Camera and place it at the origin of the camera. Then use puzzles to print to the console
Get Camera Position X and then print Get Object Position X… the values are completely different. Any ideas why these would be different?Xeon
Route 66 Digital
Interactive Solutions - https://www.r66d.com
Tutorials - https://www.xeons3dlab.com2021-09-15 at 6:01 am #44656jdhutchinsonCustomerI think if you get position of a generic ‘object’, the xyz is the actual co ordinate?
On a similar note to this question, we can ‘get’ a camera position or direction, but not use those parameters to store and then restore a cameras state with this alone. Since, we can’t remember what a camera’s target point was (look at point). This is a limitation I feel, unless I’ve missed something.
2021-09-15 at 11:39 am #44694Nurgeldi DovletovStaffHi!
For clarity, Get Object Transform puzzle returns the local transformation of the object (local position, rotation, scale, if the object has a parent then you get the transformation in the parent’s coordinate space), and Set Object Transform puzzle also does only the local transformation(in object’s space).We are working on this and will soon add transformations in the world space.
Verge3D Developer
2021-09-15 at 8:16 pm #44708xeonCustomerSo if I am understanding this correctly…. unless all objects are parented their local transform spaces are not relative to each other.
To make objects have a consistent relative transform space…they have to be parented?
What I am attempting to do is move a sphere in the direction of raycast… this part is easy. I have parented to the sphere a cube.
What I need is for the cube and sphere to be rotated based on the raycast vector. No matter what vector is given…I want the sphere to be located at the intersection of the raycast and the cube to be located 2 units further away…on the same plane as the sphere using the same xy vector from the raycast.
Example in 2D. If my starting point is (0,0,3)…and I raycast to (1,1,0), my sphere would be located at (1,1,0). I need my cube based on this to be at (3,3,0).
From the points I can calculate the line for the start (0,0) to end (1,1)…find the slope… find the intercept… and we have an equation of the line. I can then find the third point where the cube will go by adding 2 to the intercept x point and then solving for the new y. Yeilding the coordinates.
Not having any luck with this so far so I will try parent them all and see if I get a consistent transform/vector/coordinate system…once I have that the calculations are easy.
Xeon
Route 66 Digital
Interactive Solutions - https://www.r66d.com
Tutorials - https://www.xeons3dlab.com2021-09-16 at 8:41 pm #44763xeonCustomerWell as stated things are a bit funky in this area. Cameras position and rotation info is vs objects are not the same. Rotation angle are in degrees but will flip the angle calculation from clockwise to counterclockwise based on vector direction which can cause all sorts of strange flipping.
The goodnews – the parenting allows for a common coordinate space.
That solved the problem.
Xeon
Route 66 Digital
Interactive Solutions - https://www.r66d.com
Tutorials - https://www.xeons3dlab.com -
AuthorPosts
- You must be logged in to reply to this topic.