Home › Forums › General Questions › Track To constraint issue
- This topic has 15 replies, 3 voices, and was last updated 2 weeks, 5 days ago by kdv.
-
AuthorPosts
-
2023-06-21 at 2:29 pm #64749David DuperronCustomer
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 helpDavid
2023-06-21 at 10:28 pm #64757xeonCustomerI 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.com2023-06-22 at 1:31 am #64758kdvParticipantJust 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.
2023-06-22 at 8:25 am #64776David DuperronCustomerHi!
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
2023-06-22 at 3:59 pm #64791xeonCustomerHere 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.zipDrag 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.com2023-06-22 at 6:01 pm #64795kdvParticipantIs 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.
2023-06-27 at 9:17 am #64884David DuperronCustomerThanks 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.
2023-06-27 at 2:46 pm #64896xeonCustomerIf 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.com2023-06-27 at 2:48 pm #64897xeonCustomerBefore 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.com2024-09-19 at 1:10 pm #77490David DuperronCustomerHo 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!
CheersDavid
2024-09-20 at 10:04 am #77497kdvParticipantthe 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.
2024-09-20 at 12:10 pm #77500David DuperronCustomerOk, 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.2024-09-20 at 7:37 pm #77513kdvParticipantAvoid 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.
2024-09-24 at 7:53 am #77571David DuperronCustomerOk 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…).
2024-09-24 at 10:07 am #77573kdvParticipantdel
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.
-
AuthorPosts
- You must be logged in to reply to this topic.