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.

bind puzzle not working

Home Forums Puzzles bind puzzle not working

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #6824
    Pepper KUN
    Customer

    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.
    null

    Noob on blender and any other things.

    #6828
    Pepper KUN
    Customer

    Here is my html file.

    Noob on blender and any other things.

    #6835

    Hi,

    It was a bug in Puzzles – I’m attaching here a hot fix.
    Thanks! :bye:

    Attachments:
    You must be logged in to view attached files.

    Chief 3D Verger | LinkedIn | Twitter

    #6848
    Pepper KUN
    Customer

    Thx, It works well now. :good:
    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.

    #6852
    Pepper KUN
    Customer

    color anchor point(empty object) seems not working properly.
    null

    Noob on blender and any other things.

    #6859

    Hi,

    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.

    Chief 3D Verger | LinkedIn | Twitter

    #6869
    Pepper KUN
    Customer

    Thx, 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. :yes:

    Noob on blender and any other things.

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