screenmutt Posted November 20, 2013 Share Posted November 20, 2013 I am looking for a way to map rectangular textures, like the ones found on this site, onto a sphere. Right now they wrap in a weird way and just look... blah. Is there a way to do this or to convert the texture? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 20, 2013 Share Posted November 20, 2013 How do you create your spheres? With BABYLON.Mesh.CreateSphere ? Quote Link to comment Share on other sites More sharing options...
screenmutt Posted November 20, 2013 Author Share Posted November 20, 2013 Yes. That is how I created my sphere. Sorry, I should have specified. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 20, 2013 Share Posted November 20, 2013 If this case, babylon.js generates arbitrary textures coordinates. You have many options to do what you want - Use Blender to generate a sphere with appropriate texture coordinates- Use texture.uOffset, vOffset, uScale, vScale to move the texture Quote Link to comment Share on other sites More sharing options...
screenmutt Posted November 20, 2013 Author Share Posted November 20, 2013 Is there any way to change the mapping mode? Right now it wraps around instead of "pinching" like I hoped it would do. Quote Link to comment Share on other sites More sharing options...
screenmutt Posted November 20, 2013 Author Share Posted November 20, 2013 Actually. I just decided to try importing models from blender. However, now I am running into the following problem. Here is my code: // Load Blender BABYLON.SceneLoader.ImportMesh("", "", "Models.babylon", scene, function(meshes, particles) { alert('Loaded'); });And here is the error I getUncaught Error: 0 babylon.1.6.0.js:1Any thoughts? The file is definitely there. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 20, 2013 Share Posted November 20, 2013 is there any other information on the console?could you share your code somewhere? Quote Link to comment Share on other sites More sharing options...
screenmutt Posted November 20, 2013 Author Share Posted November 20, 2013 Here is the full console output:Valid manifest file not found. Scene & textures will be loaded directly from the web server. babylon.1.6.0.js:20event.returnValue is deprecated. Please use the standard event.preventDefault() instead. jquery.js:5374Uncaught Error: 0 babylon.1.6.0.js:1request.onreadystatechange babylon.1.6.0.js:1Here is a link to the project. https://www.dropbox.com/s/51x1quo8q2ke4k9/babylon-test.zip Sorry about it all being in the same file. This is really just an experiment and I am doing a lot of re-factoring as I go, meaning 1 file is the easiest to work with. It won't end up that way though! Quote Link to comment Share on other sites More sharing options...
screenmutt Posted November 20, 2013 Author Share Posted November 20, 2013 Ok guys! I figured out the problem. I used that totally awesome BABYLON VIEWER app and the files worked perfectly. So I tried simplifying what was going on with my project. Turns out I am not able to load .babylon files locally. Once I uploaded it to a server it worked perfectly. Thanks guys! Temechon 1 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 20, 2013 Share Posted November 20, 2013 In your ImportMesh the 'name' and the 'path' are empty. This is may be the error.BABYLON.SceneLoader.ImportMesh("Your name mesh here", "Your path here", "Models.babylon", scene, function(meshes, particles) { alert('Loaded');}); Quote Link to comment Share on other sites More sharing options...
Temechon Posted November 20, 2013 Share Posted November 20, 2013 I used that totally awesome BABYLON VIEWER app and the files worked perfectly. OMAGAD OMAGAD It's my app !! Thank you <3 More seriously, you won't be able to load babylon files locally. You have to get through a local server. In Babylon, all files are retrieved using AJAX requests, and for some security reasons, you cannot request a local file using AJAX. Quote Link to comment Share on other sites More sharing options...
Arjen.Stolk Posted April 6, 2014 Share Posted April 6, 2014 Does anybody know the right vOffset, vScale, uOffset, uScale to wrap a mercator projection off the earth around a sphere?I have been experimenting, but I don't seem to get it right I found out myself:The best way to wrap a rectangle mercator projection around a sphere is to create a image of 1024 by 512 or at least in these proportions. Then it wraps around beautifully.So you need to have image that is twice as high as wide. Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.