aaronmck

Members
  • Content Count

    26
  • Joined

  • Last visited

Everything posted by aaronmck

  1. Hey, that looks like a better way to do it. Thanks
  2. I currently have a Canvas2D in my scene already which handles click events on the actual meshes, which was why I was looking to add a popup error message just to keep them separate. To create the buttons I used: $('body').append('<button id="gpu_button" style="position: absolute; right: 20px; top: 110px; font-size: 1em;">Graphics Card</button>');
  3. Hello I have a mesh that loads when a button on screen is clicked. The button currently can only be clicked once so duplicate models can't be loaded. I would like for there to be a message that displays on screen if the user clicks the button more than once. var gpu_button_counter = 0; document.getElementById("gpu_button").addEventListener("click", function () { if (gpu_button_counter > 0) { return false } gpu_button_counter++; I have this current code. Can anybody provide a solution as to how I would display a message on screen if the button is clicked more than once? Thanks!
  4. Hey @alessandronunes Thanks for the reply, that works well for me Cheers!
  5. Hi all, So I've basically finished a project that I've been working on in Visual Studio which I have been running locally using IIS Express that comes with VS. Now I want someone in a different part of the country to access it by just typing in a link in the address bar. How do I go about this? I've never set up or used a server before. PS. I also have WAMPServer installed but I'm unsure how to set it up so anyone can access it at any time? Thanks!
  6. Hey, This is perfect, I got it working in my code so thanks very much, greatly appreciated!
  7. @Sebavan Here you go, a basic example of my code i'm using http://babylonjs-playground.com/#JFMP For some reason it isn't working on either of the models in that PG
  8. Hey @Sebavan This is great, very helpful. Just one issue. I have some of my models load on a button click and others that do not. The canvas 2d panel works on the models that don't load on button click but doesn't work on the models that do load on button click. Do you know why this is? Thanks!
  9. Hi all, So I'm working on a project where I need to be able to click on a mesh and have information about that mesh appear on the screen. I was told I should use Canvas2D but I'm still pretty new with this and it is simply going above my head, I haven't a clue where to start with this. Could anyone be kind enough to help me with this? I have attached a playground with what I'm looking to do. Basically I will have multiple meshes on screen and when I click / double click on one of the meshes it will display info for that particular mesh. http://babylonjs-playground.com/#BPV7F Thanks in advance!
  10. Thanks for all your responses, a great help! I referenced PEP in the document head using <script src="https://code.jquery.com/pep/0.4.1/pep.js"></script> and now I am able to interact with the meshes which is great. I went back into 3ds Max and used ProBoolean to connect all the pieces of the motherboard together so I am able to move the motherboard along the x axis by clicking anywhere on the model which rocks! I just need to figure out how to implement clicking the alt/ctrl key to move the models up and down on the y axis and utilising worldSpaceCanvas for a description to appear somewhere on screen. Slowly but surely I'm getting there. Thanks!
  11. Hey, Just to follow up if anyone has this issue in the future. I tried using ProBoolean to cut holes and union two objects and it now displays perfectly. Cheers!
  12. Sorry for being a noob but how do I reference hand.js? Is that just adding <script src="hand.js"></script> to the top of the html?
  13. The drag and drop function works in the playground but when I add the code into my visual studio code and run it, the models show up but I am unable to drag them. There are no errors reported in visual studio. I've attached a .txt file with my code if you get a chance to look at it and see if there is any issues that you can see. my_code.txt
  14. Hey @Wingnut thanks for your response. I followed your guide and created the git repository and successfully added a few of my models to the playground for testing purposes. Here it is. http://www.babylonjs-playground.com/#BUERM#0 I added the drag and drop code from the example on playground and it works, but it doesn't work when I use it in the rest of my code on Visual Studio for some reason??? A problem I found was that if my model has more than one mesh making it up I am able to move all these individual meshes rather than the full model itself as seen on the motherboard model. Any ideas on how that can be fixed so that I can click anywhere on the motherboard and be able to move the entire model? A couple of other things I would like to be able to do are; 1. Move the models up and down as well as left and right (not worried about rotating it) 2. Be able to click on a model and a description of it appears on the bottom right of the screen if that is possible? I look forward to any of your suggestions. Many thanks!
  15. Hello all, I have a quick question if anyone could help me with. I've set up a scene and imported multiple meshes that were made in 3ds Max and have them positioned where I want them on the scene. It consists of a PC case and all the PC's components beside it. Now I'm trying to implement the drag and drop function so I can click on an imported mesh and be able to drag it into the PC case and position it where it's supposed to be. I tried adding the code from the drag and drop demo from the playground into my code but when I run it, it doesn't do anything. Can I use this drag and drop function on imported meshes or is it only for meshes that are created from scratch in the code? Thanks! PS, I would add a playground with my models and code but I'm unsure how to set it up to show my models.
  16. Perfect thanks, just one more question. When I use that method on a model with multiple separate pieces it only move one piece. Can I do it so as the entire model moves?
  17. Hi, I have created a scene and I have imported multiple models using the BABYLON.SceneLoader.ImportMesh function. When I run it some of them are stacked on top of each other Could someone instruct me know how I go about positioning them in the scene please? Thanks
  18. Ok, so I figured out what the problem is. When I use the boolean function in 3ds Max to subtract a hole in another shape and try to run it in the sandbox it disappears. If I undo the subtraction and run it, it displays fine. So the boolean function in max must be affecting the geometry of the shape or something. Has anyone encountered this issue before and has a solution? Because I don't want to have to remodel everything. Thanks.
  19. @Deltakosh There are no errors reported either in the exporter or in Sandbox
  20. I checked the network tab and it displayed the name of the project as the failure. Done a bit of researching and apparently by clicking the project name from the localhost menu it doesn't add the "localhost/" prefix at the start. So I added that and I don't get the error message any more but I'm now getting a blank page. I was able to open it fine in Chrome when using Visual Studio
  21. Hi! I created a pc case model in 3ds max and added light and a camera etc... I then exported it using the babylon exporter plugin but when I view it in sandbox a lot of the pieces of the case are missing. You can see from the screenshots below what it should look like and what it looks like in Sandbox. I have attached a zip file with the 3ds max file along with the materials and the .babylon file that was created. Any help would be appreciated Aaron case.zip
  22. There's an error when I press F12 it says "Failed to load resource: net :: ERR_NAME_NOT_RESOLVED" Any ideas as to what that means? Thanks
  23. I haven't really found a solution just yet, I've added it to wamp server but it still does not display when it's run.
  24. Thanks for the reply. I definitely have babylon.2.4.js in the right directory. I was being an idiot and not using the server. I have WAMP server installed and moved the folder containing my scenes and .html file etc... into the "www" folder of wamp. How do I add the mime type in Apache so it accepts it? Sorry for being such a noob at this!
  25. Hi, I've created a simple 3d model in 3ds Max and everything exports fine and I am able to view it in sandbox with no problems. When I try to load the scene in the index.html file, all I get is a blank screen when I run it. Here is the code I'm using, if anyone could help please <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html" charset="utf-8"/> <title>PC Deconstructor</title> <script src="babylon.2.4.js"></script> <style> html, body { overflow: hidden; width : 100%; height : 100%; margin : 0; padding : 0; } #renderCanvas { width : 100%; height : 100%; touch-action: none; } </style> </head> <body> <canvas id="renderCanvas"></canvas> <script> var canvas = document.getElementById("renderCanvas"); var engine = new Babylon.Engine(canvas, true); BABYLON.SceneLoader.Load("psu/", "psu.babylon", engine, function (scene) { scene.activeCamera.attachControl(canvas); engine.runRenderLoop(function () { scene.render(); }); }); //Resize window.addEventListener("resize", function () { engine.resize(); }}; </script> </body> </html> Thanks!