Jump to content

Group2D trackNode error


renjianfeng
 Share

Recommended Posts

Then it goes bad. Duplicate labels end up everywhere,Here is an image when I rotate the camera !


                var ui = new BABYLON.ScreenSpaceCanvas2D(scene);
                var radioUi=[]
                for(var i=0;i<meshes.length;i++){
                     radioUi[i] = new BABYLON.Group2D({
                        parent: ui,
                        trackNode: meshes[i],
                        children:
                            [
                                new BABYLON.Rectangle2D({
                                    id: "mainRect", x: -5, y: -5, width: 10, height: 10,
                                    fill: "#abe2ffFF", border: "#0090ffFF", borderThickness: 3,
                                    roundRadius: 5,
                                })
                            ]
                    });
                }

 

bug canvas2d.gif

Link to comment
Share on other sites

  • renjianfeng changed the title to Group2D trackNode错误

I'm so sorry,My English is not very good,Maybe I didn't describe my problem,I added a lot of tags on the meshes,This effect is very good,
But there are some labels I don't need,They seem to be behind the camera,I don't know how to handle it....Thanks to all the people who helped me!!!

If you can read Chinese,Please Look at the words here!
我在使用canvas2d中的Group2D trackNode时,出现了一个bug,当我转动相机视野的时候,在相机的背面出现了一些不需要的标签,这些标签使用canvas2d绘制,通过trackNode绑定到所有需要的mesh上面,我不知道如何解决这个问题,感谢所有提供帮助的人。

@Deltakosh

 

Link to comment
Share on other sites

My colleague found that this method can be used to fix the bug for the time being

 
 radioUi = new BABYLON.Group2D({
                    ...
                    });
box.onBeforeDraw = function(){
   radioUi.levelVisible=true;
 }

scene.beforeRender = function(){
  radioUi.levelVisible=false;
}

 

Link to comment
Share on other sites

  • 2 weeks later...

hello @renjianfeng I'm back from holidays, I couldn't take a look sooner.

I'm glad you found a workaround but I would still like to find the bug and fix it!

Sadly, I don't understand what is special in your case to make this going bad.

We have many people using Group2D with trackNode and there is no clipping issue so far.
I know it's going to be difficult for you to explain, but can you do your best to explain what you are doing with the 3D scene objects and also with the Canvas2D nodes? The more code you share the better it will be.

If you really have difficulties to write in English, post a very well explained message in Chinese, @MasterK will translate it to me, he owe me at least this! :)

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...