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.

Track To constraint issue

Home Forums General Questions Track To constraint issue

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #64749
    David Duperron
    Customer

    Hi,
    I have an issue with a “track to” constraint that does not behave the same in Blender and Verge3D exported gltf.
    I added constraints to a “piston” with “track to” constraints in blender, and used the “Target Z” option, together with empty targets in order to avoid my parts flipping around their axis when the whole assembly rotates (when the object local Y axis starts to point downward, the constraint forces it to point upward, and then rotates the whole object around the Z axis).
    It works perfectly in blender but for some reason it does not translate in the verge3D world.
    Is there a known limitation for these constraints? any way to get around this?
    Thanks for the help

    David

    #64757
    xeon
    Customer

    I believe “Track To” is a legacy constraint and is prone to not working properly as declared in Blender documentation. You may want to try Locked Track.

    Xeon
    Route 66 Digital
    Interactive Solutions - https://www.r66d.com
    Tutorials - https://www.xeons3dlab.com

    #64758
    kdv
    Participant

    Just remember that the Blender’s coirdinate system is Z-Up-right, but the Verge3D’s native coordinate system is Y-Up-right…

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #64776
    David Duperron
    Customer

    Hi!
    Thanks for the answers.
    I juste tried the “Locked Track” constraints, whch again works well within Blender but does not in Verge3D…
    see capture below:

    The x axis of the piston is the “locked axis”, but then when I rotate the crane around its z axis, the piston x axis remains the same and does not rotate together with the crane as it should be…
    Any idea?? please help!!

    David

    #64791
    xeon
    Customer

    Here is a link to a sample file using the “locked to” constraint for a simplified object that might meet your requirements.

    Online demo – https://v3d.net/l93

    ZIP – Project File including Blend file.
    https://cdn.soft8soft.com/AROAJSY2GOEHMOFUVPIOE:f2f27a4091/TEST_LOCK_TO_CONSTRAINT.zip

    Drag the sphere around to rotate the objects.

    You probably already know but in case others are having issues:
    – be sure your “origin” for the object(s) you are wanting to rotate is located at the desired rotation axis point.
    – “apply transforms” (position, rotation and scale) to all your objects and to the target object you are tracking. Its not an issue in Blender but it solves many of the problems people have when sending this over to V3D.

    In this example: the tracking axis is Y and the locked axis is Z. You could use X as well but Z is the axis that I am rotating around so that is the “locked axis”. Its probably the same in your scene with Z up unless you have changed your coordinate system.

    Hope this helps.

    Xeon
    Route 66 Digital
    Interactive Solutions - https://www.r66d.com
    Tutorials - https://www.xeons3dlab.com

    #64795
    kdv
    Participant

    Is it really necessary to use constraints in this case instead of just parenting one object to another one? The “Track to” constraint is mainly used to force one object to look at some other object along its local +Z axis (-Y in Blender) by default. Once again: to look at. Not copying rotation or something else, just looking at.

    • This reply was modified 1 year, 3 months ago by kdv.
    • This reply was modified 1 year, 3 months ago by kdv.

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #64884
    David Duperron
    Customer

    Thanks for the help and demo files, but unfortunately I think my issue is a little more complicated than this… in fatc there are several movements in action there: the crane boom and tips are moving, and the pistons shall follow their respective attachment points on the crane AND point towards each other (piston/cylinder pointing toward each other).
    The problem is that when the crane rises almost vertical, the piston Y axis is no more pointing upward (vs World Z axis) but slightly downward, and to keep “Y Up”, Verge3D flips the piston around its Z axis 180degrees…
    See illustrations below, in Blender which does not flip the piston and let it point downward.

    #64896
    xeon
    Customer

    If you could export the offending parts to a separate blend file and share I will take a look.

    Xeon
    Route 66 Digital
    Interactive Solutions - https://www.r66d.com
    Tutorials - https://www.xeons3dlab.com

    #64897
    xeon
    Customer

    Before you do make sure all the parts have their origin in a good place and scale and rotation are applied

    Xeon
    Route 66 Digital
    Interactive Solutions - https://www.r66d.com
    Tutorials - https://www.xeons3dlab.com

    #77490
    David Duperron
    Customer

    Ho All!
    I finally took the time to pack a small demo app that reproduces the issue with the Track To constraint.
    You can play the App here:
    Track To Issue
    You need to raise the lower arm to the maximum (using the blue controllers), and then manipulate the second arm, you will see the issue near the top position and near the lower one: the pistons “flip” around their contrained axis, trying to maintain the Z-axis up I guess…
    and the source blend file is attached to this post.
    I can’t figure out why this constraint does not work once exported!
    Any help would be greatly appreciated!
    Cheers

    David

    #77497
    kdv
    Participant

    the pistons “flip” around their contrained axis, trying to maintain the Z-axis up I guess

    exactly. that’s normal behavior for this constrain in three/v3d. the Up axis is always directed upwards. that’s why your object rotates at zero angle position.

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #77500
    David Duperron
    Customer

    Ok, so there is no way I can achieve the same behavior as in Blender in V3D/Three using this kind of constraint (because inside Blender this issue does not occur!)?
    I’ve got similar results when trying to use a mix of “set object direction” puzzle, and “limit rotation” constraint puzzles.

    #77513
    kdv
    Participant

    Avoid vertical zero angle when using the “Track To” constraint…

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #77571
    David Duperron
    Customer

    Ok that would of course “solve” this issue, but I’m not controlling the actual design of the equipment I need to replicate, and these cylinders actually DO cross the vertical axis, so I guess I will have to live with this weird flipping ( that goes unnoticed most of the time luckily…).

    #77573
    kdv
    Participant

    del

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

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