

zzlettle
Members-
Content count
7 -
Joined
-
Last visited
About zzlettle
-
Rank
Newbie
-
-
solved how and when to use the Matrix decompose() api?
zzlettle replied to zzlettle's topic in Questions & Answers
thanks now i know the decompose() suage regards @Deltakosh -
solved how and when to use the Matrix decompose() api?
zzlettle posted a topic in Questions & Answers
hi i get confused by the function Matrix decompose() api in this tutorial https://doc.babylonjs.com/resources/frame_of_reference i know mesh has its world matrix and its local frame of reference after apply some transform ( position, rotate and scale) whenever we want to get the mesh`s world matrix we can call mesh.getWorldMatrix(true); right? and i see lots of people use decompose() function after i checking its usage i thought the decompose() is for decompose a matrix like the mesh world matrix to get how the mesh be transformed that is to say how a identuty matrix [ BABYLON.Matrix.Identity()] be position, rotated and scaled by using decompose(scale?: Vector3, rotation?: Quaternion, translation?: Vector3) we can get those three components am i right ? till i see some people use it in this way m.decompose(BABYLON.Vector3.Zero(), BABYLON.Quaternion.Identity(), position) that make me confused how can i set the components the scale set to BABYLON.Vector3.Zero() the rotation set to BABYLON.Quaternion.Identity() can some one tell me why? and how the matrix decompose() exactly the correct usage regards -
[solved]how to make the target mesh of camera not fix in the center screen?
zzlettle replied to zzlettle's topic in Questions & Answers
ok i get it thanks johnk -
[solved]how to make the target mesh of camera not fix in the center screen?
zzlettle replied to zzlettle's topic in Questions & Answers
hi @JohnK https://www.babylonjs-playground.com/#MWYX7P#2 in the code line 30 focusTarget.position = new BABYLON.Vector3(0, 0, 0); even i comment it ,it works the same or i modify the Vector3(0,0,0) to Vector3(-10,-10,-10) it change nothing looks like the focusTarget TransformNode`s position can not be changed -
[solved]how to make the target mesh of camera not fix in the center screen?
zzlettle replied to zzlettle's topic in Questions & Answers
thanks JohnK and Arte that is the thing want . -
[solved]how to make the target mesh of camera not fix in the center screen?
zzlettle replied to zzlettle's topic in Questions & Answers
hi thanks wingnut for your so quickly reply your code works in ArcRotateCamera very well however in my game i want use the ArcFollowCamera in this way ,it will more simply to fix the player view here is the simple playground: https://www.babylonjs-playground.com/#MWYX7P as you can see the target box is always fixed at the center of screen in the line 46 after i add camera.target = camera.target.subtract(new BABYLON.Vector3(-3, -10, 0)); it show an error Line 46:43 - camera.target.subtract is not a function all i want is .the target box in the left bottom of the screen as the picture show .or any other position i want something i code wrong? is there any api function i can use for it ? regards -
[solved]how to make the target mesh of camera not fix in the center screen?
zzlettle posted a topic in Questions & Answers
hi i am new to babylonjs,this is the first post i made. my problem is that i make a camera,no matter the ArcRotate Camera ,FollowCamera or ArcFollowCamera the target mesh just fixed the position in the center of the screen that is very good for lots of game however i just want to make my game the target mesh a little offset at the center of screen like :at the middle bottom left screen. or any other position i want is there a simply way or a api to make it ? thanks