- This topic has 6 replies, 2 voices, and was last updated 6 years, 3 months ago by Pepper KUN.
-
AuthorPosts
-
2018-08-30 at 3:59 am #6824Pepper KUNCustomer
Hi,there. I got some issues on bind puzzle. I want to bind a button on an empty object. Here is how my puzzles placing. There is no button element attaching on my pie object. I check the button element on DevTools, there is no left or top css property on my button. Also the red line which should be draw was missing. I don’t know whats going on because console show no error or warning.
Noob on blender and any other things.
2018-08-30 at 4:03 am #6828Pepper KUNCustomerHere is my html file.
Noob on blender and any other things.
2018-08-30 at 9:12 am #6835Yuri KovelenovStaff2018-08-31 at 3:08 am #6848Pepper KUNCustomerThx, It works well now.
By the way, how to rotate an object in Z axis. I try that below but doesn’t work.var red_p = 0.47; var blue_p = 0.15; var i = 180 / Math.PI; var j = 360 / Math.PI; var red_anchor = i*red_p; var blue_anchor = j*red_p + i*blue_p; var white_anchor = i * (red_p + blue_p + 1); var object = app.scene.getObjectByName("pie"); var anchor_red = app.scene.getObjectByName("center_red"); var anchor_blue = app.scene.getObjectByName("center_blue"); var anchor_white = app.scene.getObjectByName("center_white"); var mat = object.material; var index1 = mat.nodeValueMap['red_percent']; var index2 = mat.nodeValueMap['blue_percent']; mat.nodeValue[index1] = red_p; // red part percent mat.nodeValue[index2] = blue_p; // red part percent anchor_red.rotateZ(red_anchor); anchor_blue.rotateZ(blue_anchor); anchor_white.rotateZ(white_anchor);
Noob on blender and any other things.
2018-08-31 at 4:06 am #6852Pepper KUNCustomercolor anchor point(empty object) seems not working properly.
Noob on blender and any other things.
2018-08-31 at 3:24 pm #6859Yuri KovelenovStaffHi,
Glad it worked for you.
Regarding rotation via API, please be advised that the rotateZ method works in engine coordinate system. Z axis in Blender corresponds to Y in Verge3D.
BTW, are you trying to implement billboards? Because you can use the TrackTo constraint with the camera as its target.
2018-09-03 at 3:01 am #6869Pepper KUNCustomerThx, it’s all done.
BTW, are you trying to implement billboards? Because you can use the TrackTo constraint with the camera as its target.
Yes, the dots on the end of the lines are quite similar to billboard. I use html element bind to it instead of object Track to camera because I want to change the dot style through CSS file. The other way is not so convenient. Next time I will use object track to camera if I want my billboard can be blocked by other objects.
Noob on blender and any other things.
-
AuthorPosts
- You must be logged in to reply to this topic.