MarianG

Members
  • Content count

    257
  • Joined

  • Last visited

  • Days Won

    2

MarianG last won the day on January 3

MarianG had the most liked content!

About MarianG

  • Rank
    Advanced Member

Contact Methods

  • Website URL
    https://www.smarteam3d.com/
  • Skype
    marian.gaje

Profile Information

  • Gender
    Male
  • Location
    Baia Mare, RO

Recent Profile Visitors

1,906 profile views
  1. Creating Constant-Width 2D Lines

    Finally, I figure it out using simple plane, here is: function createLine(p1,p2) { var line = BABYLON.MeshBuilder.CreatePlane("wire", {height: 1, width: 1, sideOrientation: BABYLON.Mesh.DOUBLESIDE}, scene); var dist = BABYLON.Vector3.Distance(p1, p2); var rotAngle = Math.atan((p1.x - p2.x)/(p1.z - p2.z)); line.position = BABYLON.Vector3.Center(p1, p2); line.rotation = new BABYLON.Vector3(Math.PI/2, rotAngle + Math.PI/2, 0); line.scaling = new BABYLON.Vector3(dist, customWidth, 1); line.material = new BABYLON.StandardMaterial("mat", scene); line.material.diffuseColor = BABYLON.Color3.White(); return line; }
  2. I can confirm, metadata was the trick. It is exactly what I want. Many thanks!
  3. Device Scaling Resolution

    here we go: http://playground.babylonjs.com/#ZR8GLF
  4. I did not know about metadata. Thank you for sugestions. I'll make a try, and I'll be back with news.
  5. Device Scaling Resolution

    Hey. I had a similar problem. I solved it using this function when canvas resize. I don't have too much time now, but I'll provide a playground later. Play with it function fitToView() { //component - is an object from the midle of the scene :)) component.computeWorldMatrix(true); let radius = component.getBoundingInfo().boundingSphere.radiusWorld; let aspectRatio = engine.getAspectRatio(scene.activeCamera); let halfMinFov = scene.activeCamera.fov / 2; if (aspectRatio < 1) { halfMinFov = Math.atan( aspectRatio * Math.tan(scene.activeCamera.fov / 2) ); } let viewRadius = Math.abs( radius / Math.sin(halfMinFov)); scene.activeCamera.radius = viewRadius; }
  6. Hi. I have two scene. In the first scene I configure the object from babylon basic elements and csg, I serialize it and upload it to server. All good In the second scene I import the serialized object from first scene. All good again. But in the first scene I set some flags to the object and after I serialize it, they gone, ... no problem I add them manual. like that. var myser = BABYLON.SceneSerializer.SerializeMesh(component, false, true); var jsonData = JSON.stringify($.extend({}, myser, {"setings":settings})); And it works again but when I use SceneLoader.ImportMesh I get only the informations from "myser", and this is somewhat expected. But my question is, how can I hack the ImportMesh function to access "setings" property too? Or can I add the flags from 'seting' to my original mesh before to serialize, and it don;t lose them when I serialize it? Thank you guys
  7. Model flip issue

    try to turn of the backfaceculling, something like mesh.material.backFaceCulling = false; //or mesh.material.subMaterials[0].backFaceCulling = false;
  8. Holes in extruded shape

    Hi Topper. I used csg a few months ago. You can take a look. Maybe can help. The goal was to create a generator for holes on meshes, but I need time, and now I haven't too much.
  9. [Solved] Skybox config issue

    Hi @Snouto Check your camera maxZ. If it is too small, increase it, something like this. scene.activeCamera.maxZ = 1000;
  10. Creating Constant-Width 2D Lines

    I know, but I have to draw lines on a plane on XoZ using only x anz z values, and I can't use simple lines because I have to chenge line width. Thanks anyway, I'll try with a dynamic texture.
  11. Creating Constant-Width 2D Lines

    Good job @JohnK What about to use it on XoZ axis? I tried to do some changes on 2dLine system but witout succes
  12. [SOLVED] Remove child properly from mesh

    try child.setParent(null)
  13. 3d drag and drop menu

    Yay. This is it. Many thanks @Amarth2Estel
  14. Hi. As the title say, I'm trying to do a menu with 3d objects and you can drag objects from menu to the scene. It is basic yet. I'll add more features soon. I've been trying to fix it for a while, so I decided to ask for help So it's simple. We have a scene with a grid, and on top a menu with 3d objects. The mesh that holds the 3d objects is parented to the camera., and about 300 on z axis. I create a transparent plane at the same distance from camera and parent it to camera too, for drag and drop. It works well, but on drop I want to project the position of the 3d object on the grid somehow, but I do not figure it out. So I decide to put it on midle default. Here is the sample: http://playground.babylonjs.com/#ANU67L#3 #line 131 is the default, and on #line 130 i tried something but without succes. Any help are welcome. Pace and love
  15. RGB loadingUIBackgroundColor

    You have this BABYLON.Color3.FromHexString("#000000"); and back you have this yourColor.tohexstring()