We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

[SOLVED]. CAMERA POSITION IS IT VECTOR OR COORDINATE?

Home Forums Puzzles [SOLVED]. CAMERA POSITION IS IT VECTOR OR COORDINATE?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #44653
    xeon
    Customer

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

    #44654
    xeon
    Customer

    To 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.com

    #44656
    jdhutchinson
    Customer

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

    #44694

    Hi!
    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

    #44708
    xeon
    Customer

    So 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.com

    #44763
    xeon
    Customer

    Well 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

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.