Pryme8 Posted March 30, 2016 Share Posted March 30, 2016 What is the standard UV map layout for a Primitive Cube? If I just export a texture from a cube in my 3d program set to cubic will it transfer over? And then to make this question even more interesting... how would I export a outline of a UV map created in BJS as say a JPG with the background being white and the polygon lines black. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted March 31, 2016 Share Posted March 31, 2016 Wingy starts by handing you a cold wash cloth, a chill pill, and an inflatable collaborator. heh - Standard UV map for prym8ive cube? Learnable here: http://doc.babylonjs.com/tutorials/CreateBox_Per_Face_Textures_And_Colors - Will exported "box" with texture... transfer to BJS? Likely. Try it. Read about your modeler's UV mapping. View your exported .babylon file... see what you find in there. Did you know that you can "paste" the data of a .babylon file... into a playground? http://www.babylonjs-playground.com/#VMFNH#20 Now you don't even need a modeler... to test how BJS handles things that are "fed" to it. Cool, huh? - Export a UV map created in BJS? BJS is a viewer, not a modeler or texture editor. [Wingy flips-on the "listen intently" switch on Pryme8's new inflatable collaborator, and leaves to get fresh coffee] heh Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted March 31, 2016 Author Share Posted March 31, 2016 see thats where im shifting the game... BJS has the power and ability to be a fully deployed in browser 3d modeler it just no-one has really pushed that direction... But thats where I come in. Ive deployed a similar system in unity's editor but stopped development on that when I started working on my WarMachine plugin for unity that was a procedural content generator. Now is the time, I have a really really really big plan that I think you out of everyone kinda knows where Im heading from our private conversations. Its just a desperate scramble to obtain as much general knowledge of process I need to address before its time to tackle them. From what Im reading though, it seems like we may not have an unwrap method yet, I dont think it will be too hard to do a cubic interpolation unwrap for the time being just to get things rolling, but optimum angle and other projections may be a little rougher for me to figure out. Quote Link to comment Share on other sites More sharing options...
spoderman Posted March 31, 2016 Share Posted March 31, 2016 ordinary i would say its a job for an 3d applycation... but if you have a special case of use lets try this: i think the babylon cube has a full size planar mapping on every face. this means, if you add a texture, the texture gets mappet fully on every side of the cube. If you want to export the uv-layout just draw the uv coordinates on an 2d canvas. Note: the uv space normaly live in a 0.0 to 1.0 space. Pryme8 1 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted March 31, 2016 Author Share Posted March 31, 2016 Spoder I love you, this is what information I needed. Now, the question is can I overwrite this layered planar projection, physically not just in the GL interp. Like I dont want the projection to be layered, I would want to be able to assign each uv face to a section of my 2d canvas, and when I bring it back in have it match. Quote Link to comment Share on other sites More sharing options...
spoderman Posted March 31, 2016 Share Posted March 31, 2016 the uv-mapping is part of the model-information. this means, if you are going to create geometry ( including the standart primitives) at runtime, the geometry's information it stored in memory. If you want to save the model you need to create a file, which contains this informations, on the server side, for example. Pryme8 1 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted March 31, 2016 Author Share Posted March 31, 2016 Would you be so kind as to demonstrate in a playground a simple cube made in bjs. Exported as an obj with a 6 side non tiled uv projection and if possible a black and white jpg of the 2d uv projection. So that like let's say we reimport that cube and the jpg as the texture after we edited it's look in like photoshop and have it project the texture correctly. I will do a back flip. Quote Link to comment Share on other sites More sharing options...
spoderman Posted March 31, 2016 Share Posted March 31, 2016 sorry, man! i'am new to babylon as well... this is pure theory. Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted March 31, 2016 Author Share Posted March 31, 2016 programmer challenge! I have like 6 things i need to do before I do this but if you wanna tinker at it and figure something out before I do, I will give you buko credits when I deploy it here. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted April 1, 2016 Share Posted April 1, 2016 You can just deploy it "there" (not "here"), but paste us a link to "there". This is a distributed commune and "here" does not accept deployments. The BJS main website accepts URLs to deployments, though. If you play your cards right, you could have a link out there... that takes you to Pryme8's Cave. Coooool. (Why is it SO fun to mess with you, P8? God, I love pummeling you. You sure have a lot of energy!) Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted April 1, 2016 Share Posted April 1, 2016 Pryme8 let me ask again your question you wanna make box with babylonjs MeshCreator and you wanna texture all face with diffrent pixs (like 6 pix)? f it is your problem you don't need box UV map Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted April 1, 2016 Author Share Posted April 1, 2016 I want to be able to unwrap and change projections of UV's created in BJS. Ill figure it out here soon. Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted April 1, 2016 Share Posted April 1, 2016 you can use ShaderBuilder Extension On BabylonJs http://www.babylonjs-playground.com/#FT2RY#30 and make your textures use with colors on the pix you need 6 colors on 2 first row you use others for other Color mesh.material = new BABYLON.ShaderBuilder() .InLine('if(nrm.x<0.){') // face condition .Map({ path: "textures/co.png", //picture url indexCount: 3, // row and column Index count rowIndex: 1, columnIndex: 1, }) // select index of row and column .InLine('} if(nrm.z<0.){') .Map({ path: "textures/co.png", indexCount: 3, rowIndex: 1, columnIndex: 2, }) .InLine('} if(nrm.x>0.){') .Map({ path: "textures/co.png", indexCount: 3, rowIndex: 1, columnIndex: 3, }) .InLine('} if(nrm.z>0.){') .Map({ path: "textures/co.png", indexCount: 3, rowIndex: 2, columnIndex: 1, }) .InLine('} if(nrm.y>0.){') .Map({ path: "textures/co.png", indexCount: 3, rowIndex: 2, columnIndex: 2, }) .InLine('} if(nrm.y<0.){') .Map({ path: "textures/co.png", indexCount: 3, rowIndex: 2, columnIndex: 3, }) .InLine('} ') .BuildMaterial(scene); Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted April 1, 2016 Author Share Posted April 1, 2016 can this be done with more complex shapes? can you do a sphere with just black lines where the vertex edges are? Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted April 1, 2016 Share Posted April 1, 2016 you see we have condition "if(nrm.x<0.)" you can manage that and find your face with normal and any other parameter and about your pic you can make it 10x10 (row and column) but for big obj i recommand make uv map with other 3d applications Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted April 1, 2016 Author Share Posted April 1, 2016 ahh ok I see what your doing, now take this process and reverse it. I want output form BJS not input to. Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted April 1, 2016 Share Posted April 1, 2016 it is possible but i think it is not useful UV map generator is big process for all mesh for make that you need canvas 2d render for draw your uv or you can make that on 3d and you need a optimized algoritm for open Mesh face on the flat 2d plan and screen shot on current look 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.