Announcement

Collapse
No announcement yet.

Three.js support for Bridge.NET

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Three.js support for Bridge.NET

    Hi Daniil,

    About the typelib of three.js:
    I have created a repo on Github: https://github.com/guidovanhilst/SharpThreejs

    Live demo: http://creativecadtechnology.com/threejssharp/

    There is the complete project including VS2013 project files.
    It should be ready to build.

    after build run demo.html in browser.
    If you have time, maybe you want to take a look? :)

    Best regards,

    Guido
    Last edited by guidovanhils; 2016-02-11 @ 04:08 AM.

  • #2
    You made our day (week, month, year)! The demo looks great! Sharing the library in GitHub is awesome! It is a big and great contribution into the Bridge world. Thank you very much. I've twitted about it.

    A few things.

    1. You can avoid empty methods' bodies using an extern modifier. It would make the bindings even cleaner.

    For example, this
    public Vector3 getWorldDirection(Vector3 vector = null)
    {
        return default(Vector3);
    }
    might be revised with
    public extern Vector3 getWorldDirection(Vector3 vector = null);
    Recently, we ran some utility to get rid of empty bodies in all the Bridge source code. There is a link to the utility.
    https://github.com/bridgedotnet/Brid...ment-173421588

    2. Do you prefer names started from a lowercase letter? Say, methods' names. That is not a problem to us. Just it looks like an uppercase first letter is the most accepted in C# world. It is why we chose uppercase for Bridge. Please note that to JavaScript it is emitted as lowercase anyways. But yes, uppercase might be confusing for Three.js developers. So, it is up to you to finally decide. I just shared my thoughts.

    3. We noticed that creating NuGet packages is an extremely efficient way to spread a word and, potentially, bridge contributors to your GitHub repo. At some point, you might want to create a Bridge.ThreeJS (or .Threejs) NuGet package. For example, another community member ProductiveRage followed this way with his Bridge.React bindings.
    https://github.com/ProductiveRage/Bridge.React
    https://www.nuget.org/packages/Bridge.React

    Please don't hesitate to ask us if you need any assistance.

    Again, thank you very much for the contribution! It is awesome.

    Comment


    • #3
      Interesting, I ran into another C# bindings for Three.js.

      guidovanhils, maybe, there is an opportunity to join forces. I wrote the following post:
      https://github.com/delaneyj/three.net/issues/5
      Last edited by Daniil; 2016-02-11 @ 11:02 AM.

      Comment


      • #4
        Hi Daniil,

        Thank you for your reply.

        public extern Vector3 getWorldDirection(Vector3 vector = null);
        Yes this looks much cleaner! thanks



        Do you prefer names started from a lowercase letter?
        I just started copying javascript code and then did right click CreateMethod/CreateMember
        First I change it to uppercase but then I was getting lazy and did all lower. I diside later.. :)


        We noticed that creating NuGet packages...
        I had the solution copied from another project(I think your ( Cube3D.sln) I shall make the package again, and remove bridge-assemblies from repository
        Then I make a NuGet for the three js typelibrary as well.


        Again you really did great job with Bridge.net
        I come from c/c++ world, Its nice to do all refactoring in a typed environment.
        Bridge compiler really make me feel C# IS the source.
        Debugging in browser is no problem because there is a 1 to 1 relation between the generated javascript en the c# code.

        Thank you brigde.Net for making me code in c# and not plain javascript. ;)
        Last edited by guidovanhils; 2016-05-11 @ 10:55 AM.

        Comment


        • #5
          Original thread:

          http://forums.bridge.net/forum/gener...ing-bridge-net

          Comment


          • #6
            Then I make a NuGet for the three js typelibrary as well.
            Again you really did great job with Bridge.net
            Thank you brigde.Net for making me code in c# and not plain javascript. ;)
            Very happy to hear that! Also thank you for sharing all the other details!

            Comment


            • #7
              Hi guidovanhils,

              Curious how is it going with Bridge + ThreeJS so far?

              If/when you have a chance, please consider a possibility to share your experience in the Who Is Using Bridge.NET forum thread.

              Comment

              Working...
              X