
jschwuch
Members-
Posts
41 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
jschwuch's Achievements
Newbie (1/14)
19
Reputation
-
I made a cabinet planner for a webshop. It's in german only but maybe you would like to take a look anyway There might still be some bugs, if you find one feel free to tell me. The first (room layout) and second (planning your cabinet) steps are done with orthographic cameras. The third step then uses an arc rotate camera and one can switch to a walkthrough mode and see what it would look like in your cabinet. I'm curious about your feedback. https://www.frank-schranksysteme.de/3d-schrankplaner/
-
FelipeBaltazar reacted to a post in a topic: Babylon objects to .obj file
-
Hi @FelipeBaltazar, I really think we shouldn't modify the meshes when exporting the scene as I don't think people expect this to happen. Maybe we could add a flag if the function should bake the vertices or calculate the coordinates from worldMatrix defaulting to calculating the coordinates. I would be highly irritated if my meshes change when exporting a scene and it could cause major problems for people who build their meshes from scratch.
- 38 replies
-
- obj
- babylon to obj
-
(and 1 more)
Tagged with:
-
Hi! The bake of bjs applies the transformations you set to the vertices. So you change the meshes. Additionally the baking seems to update the worldMatrix from the rotations and translations set on the mesh. But because i never set rotation and translation in my project but the world Matrix directly the baking doesn't work for me. If you're ok with changing your meshes you can instead use the baking. It just doesn't work out for me
- 38 replies
-
- obj
- babylon to obj
-
(and 1 more)
Tagged with:
-
FelipeBaltazar reacted to a post in a topic: Babylon objects to .obj file
-
Thx! @FelipeBaltazar, this was a great point to start at. I changed some things because I'm abusing BJS when it comes to worldMatrices (I'm setting them directly) so this code exports as if transform where baked into the vertices. I also fixed the problems with the indices. Problem was, that obj doesn't start counting from 1 again when a new object begins, so we have to keep track of how many vertices we already exported. Here's my version: function exportOBJ(selectedItems) { var output = []; output.push("mtllib savedFile.mtl"); var v = 1; for (var j = 0; j < selectedItems.length; j++) { if (selectedItems[j].isEnabled() && selectedItems[j].material && selectedItems[j].material.alpha && selectedItems[j].visibility) { output.push("g object" + j); output.push("o object_" + j); output.push("usemtl " + selectedItems[j].material.id); var g = selectedItems[j].geometry; var rotM = selectedItems[j]._worldMatrix.clone(); rotM.m[12] = 0; rotM.m[13] = 0; rotM.m[14] = 0; trunkVerts = g.getVerticesData('position'); trunkNormals = g.getVerticesData('normal'); trunkUV = g.getVerticesData('uv'); trunkFaces = g.getIndices(); var curV = 0; for (var i = 0; i < trunkVerts.length; i += 3) { var vert = new V3(trunkVerts[i], trunkVerts[i + 1], trunkVerts[i + 2]); vert = V3.TransformCoordinates(vert, selectedItems[j]._worldMatrix); output.push("v " + vert.x + " " + vert.y + " " + vert.z); curV++; } if (trunkNormals) { for (var i = 0; i < trunkNormals.length; i += 3) { var vert = new V3(trunkNormals[i], trunkNormals[i + 1], trunkNormals[i + 2]); vert = V3.TransformCoordinates(vert, rotM); output.push("vn " + vert.x + " " + vert.y + " " + vert.z); } } if (trunkUV) { for (var i = 0; i < trunkUV.length; i += 2) { output.push("vt " + trunkUV[i] + " " + trunkUV[i + 1]); } } for (var i = 0; i < trunkFaces.length; i += 3) { if (!(trunkFaces[i] == undefined) && !(trunkFaces[i + 1] == undefined) && !(trunkFaces[i + 2] == undefined)) { output.push( "f " + (parseInt(trunkFaces[i]) + v) + " " + (parseInt(trunkFaces[i + 1]) + v) + " " + (parseInt(trunkFaces[i + 2]) + v) ); } } v += curV; } } var text = output.join("\n"); var fileBlob; try { fileBlob = new Blob([text]); } catch (e) { var blobBuilder = window.BlobBuilder || window.MozBlobBuilder || window.WebKitBlobBuilder; var bb = new blobBuilder(); bb.append([text]); fileBlob = bb.getBlob(); } var URL = window.URL || window.webkitURL; var link = URL.createObjectURL(fileBlob); return link; } Oh, and I'm only exporting visible meshes with material and material.alpha != 0 because I need this. Big thx to everyone for pointing me in the right direction
- 38 replies
-
- obj
- babylon to obj
-
(and 1 more)
Tagged with:
-
jschwuch reacted to a post in a topic: Babylon objects to .obj file
-
But I could export all meshes of my scene to one obj file without merging them? That would be great for rendering my scenes in blender and giving the renders to customers.
- 38 replies
-
- obj
- babylon to obj
-
(and 1 more)
Tagged with:
-
jschwuch reacted to a post in a topic: alpha = 0 not fully transparent
-
That's some new info for me too thx @Sebavan !
-
dinod reacted to a post in a topic: 2D UI in WebVR?
-
jschwuch reacted to a post in a topic: alpha = 0 not fully transparent
-
@aWeirdo That's exactly what i wanted to say but i called it opacity as that's what I call it in my project Sorry for that and thx for your correction
-
jschwuch reacted to a post in a topic: Babylon objects to .obj file
-
@Deltakosh is this documented anywhere? And can I export a whole scene to .obj or another format so I can get the my scene from babylon to Blender? This would be great!
- 38 replies
-
- obj
- babylon to obj
-
(and 1 more)
Tagged with:
-
Wingnut reacted to a post in a topic: Apply different texture or color between to point of tube
-
@Hersir you could maybe try copying the ._delayLoadingFunction over to the new mesh, but I don't know if that would create any new problems... I'll sniff around the source a bit later today... really wouldn't expect this to happen.
-
Are you sure this only occurs when you are cloning the mesh? I'd have done the cloning exactly that way and don't see why it would cause this error
-
Apply different texture or color between to point of tube
jschwuch replied to Brijesh's topic in Questions & Answers
My guess is, what you want can be done with MultiMaterial and submeshes. Here's a tutorial, hope it helps https://www.eternalcoding.com/?p=283 -
@aWeirdo the left-handedness of BJS has nothing to do with the Y-Axis beeing "up". The left-handedness means, that bigger x values mean the object moves to the left not the right. You can have a right-handed coordinate system that has Y going up too. Y beeing up instead of Z is just another design decision one has to make besides the handedness Example for left and right handed coordinate systems from wikipedia: https://en.wikipedia.org/wiki/Cartesian_coordinate_system#/media/File:3D_Cartesian_Coodinate_Handedness.jpg
-
Hi! Can you reproduce it in the playground? I just tested it and they are not visible in my test playground http://www.babylonjs-playground.com/#600LYK#1 If you can't reproduce it and need a workaround. You can set the meshes opacity visibility instead of the materials alpha, maybe that works as expected, ultimately you could set the meshs layermask to zero if it's materials alpha is zero. But those are of course options on a per mesh basis and not per material which may be a problem in your project I'll try my best to find the problem if you can reproduce it in the playground.
-
GameMonetize reacted to a post in a topic: 2D UI in WebVR?
-
GameMonetize reacted to a post in a topic: [SOLVED] Refresh rate for camera
-
royibernthal reacted to a post in a topic: Canvas2D Text2D Opacity (Bug?)
-
Ok, thx for the info, than I'll consider changing my setup to using rendertargettextures.
- 4 replies
-
- refresh rate
- camera
-
(and 1 more)
Tagged with:
-
I suspect you tried to use the screenSpaceCanvas. It's expected that it is only visible on "one" eye as it's positioned relative to the screen, which is "split in half" for VR, and not to the scene. I prepared an example utilizing the worldSpaceCanvas that shows canvas2D elements on both eyes http://babylonjs-playground.com/index.html#NJBBC9