- This topic has 10 replies, 2 voices, and was last updated 1 year, 11 months ago by liranhersh.
-
AuthorPosts
-
2022-12-25 at 2:51 pm #59224liranhershParticipant
hello everyone I am discouraged dont find answer
I create in blender 3d character walking animation in a loop. the “headbone” of this amature (there is no keyframe to this bone) I connect to Cross with bone constraint – track to.
in blender when the walk animation working, I can take the cross and move around, the head follow the rotation after the cross.now, in Verge3D, I want to move the head to side by move the cross after the mouse pointer around, how can I do it?
here I upload a video with the problem, tnx!
https://youtu.be/buyQo_9P5aQAttachments:
You must be logged in to view attached files.2022-12-26 at 2:48 am #59234kdvParticipantYou already have the solution https://www.soft8soft.com/topic/camera-problem-with-puzzles/ in your own topic.
Just uncheck “inverted” and increase the factor from 3 to 10+. This factor defines the distance between the scene camera and your object.
https://v3d.net/av8Puzzles 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.
2022-12-26 at 9:47 am #59243liranhershParticipantok, the cube follow the cross mouse this is good. but the headbone didn’t follow the cube, even the “track to” constraint in blender.
maybe something that define the connection between the cube to the headbone of the character with “track to” constrain.
I used “chatgpt” it provied me a javascript code that define the conection.
this is the code but it still dont working:// Get a reference to the object with the constraint applied
var object = app.getObjectByName(“Armature_mixamorig_Head”);// Set the target object or point for the constraint
var target = app.getObjectByName(“Cube”);// Apply the constraint to the object
object.trackTo(target);can you help please?
2022-12-26 at 12:20 pm #59244kdvParticipantapp.getObjectByName(‘Cube’)
this won’t work.
app
has nogetObjectByName
function. this will return an error.app.scene.getObjectByName('Cube')
will work. and objects don’t havetrackTo()
function. The entire code above is a nonsence.I’m not sure that Verge3D supports bone constraints. Looks like they are not exported. But you can break the system and create a standard constraint.
https://v3d.net/dqvPuzzles 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.
2022-12-26 at 10:11 pm #59251liranhershParticipantI did the same code like in the picture I add.
no working. but when I delete the exec script, the cube following well after the mousemovement/what is the problem with the java script?
app.controls.enableRotate = false; //disable camera rotation
const target = app.scene.getObjectByName(‘Cube’);
const constraint = new v3d.TrackToConstraint(target);
constraint.trackAxis = ‘Y’;
constraint.upAxis = ‘Z’;
constraint.fixCameraLightRotation = true;
const bone = app.scene.getObjectByName(‘Armature_mixamorig_Head’);
bone.constraints.push(constraint);Attachments:
You must be logged in to view attached files.2022-12-27 at 5:35 am #59253kdvParticipantpress F12 and see errors in the browser console. your code is working (one typo: constraint.upAxis = ‘-Z‘;). problems can be with the target or bone objects. see the log which of them is undefined.
p.s. share your app files or blend file.
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.
2022-12-27 at 1:45 pm #59263liranhershParticipantTNX :)
WHAT IT MEAN THE PROBLEMS, I DONT UNDERSTAND, WHAT I NEED TO CHANGE IN THE SCRIPT CODE?Attachments:
You must be logged in to view attached files.2022-12-27 at 2:59 pm #59265kdvParticipantremove the first line in the script. Looks like you use camera with no controls or it’s not the orbit camera and there is no need to disable the camera rotation. red error warnings are in English and they can be read and analyzed )))
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.
2022-12-27 at 3:46 pm #59266liranhershParticipantThank you very much kdv77kdv,
I tried deleting the first row and it still doesn’t work, very frustrating.I tried to understand the comments in red and could not solve the problem. I am uploading here a link to the file in Blender, could you please help me to do it correctly in verge3d?
thank you very much for everything
2022-12-27 at 4:20 pm #59267kdvParticipantsee no problems with your sheep. it works as expected with no additional actions from my side…
const target = app.scene.getObjectByName('cross'); const constraint = new v3d.TrackToConstraint(target); constraint.trackAxis = 'Y'; constraint.upAxis = '-Z'; constraint.fixCameraLightRotation = true; const bone = app.scene.getObjectByName('Armature_mixamorig_Head'); bone.constraints.push(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.
2022-12-27 at 4:27 pm #59270liranhershParticipantthank you so much!!!!!!!!!!!!!!!!!!!!!! it working
-
AuthorPosts
- You must be logged in to reply to this topic.