dystop1a

Members
  • Content Count

    7
  • Joined

  • Last visited

About dystop1a

  • Rank
    Newbie

Recent Profile Visitors

894 profile views
  1. In advance sorry about my lack of reading the documentation! I tried looking at the Phaser Examples and looking around... How to link a "Image Layer" from a JSON tilemap generated from Tiled program? In the "preload" function I have the asset loaded: game.load.image('exit', 'map/exit.png'); Then in "create" function I have tried both: platforms = map.createLayer('exit'); //ERROR - Tilemap.createLayer: Invalid layer ID given: null & platforms = map.addTilesetImage('exit'); //ERROR - Phaser.Tilemap.addTilesetImage: No data found in the JSON matching the tileset name: "exit" Neither works!? map.JSON (i tried moving the exit.png into the route and the image is inside the same folder as the map.JSON file). { "height":130, "layers":[ { "height":0, "image":"exit.png", "name":"exit", "offsetx":3943, "offsety":368, "opacity":1, "type":"imagelayer", "visible":true, "width":0, "x":0, "y":0 },
  2. Many thanks Jerome!!! I finally....got it working! thanks for your help. its confusing at first but thanks to your great information above it helped me solve this. If anyone else is looking to add multiple textures to a Babylon Cylinder Mesh, Make a Square image (whatever size needed 500x500 etc). Split it in 4 segments (four 250x250 parts) then add the graphics to the two lower segments for the top/bot textures.. Please note I am not using a middle texture (but theres room to add it to the top half of the texture map). uv[0] = new BABYLON.Vector4(1,0, .5, .5); //botuv[1] = new BABYLON.Vector4(0, 0, 0, 0); //miduv[2] = new BABYLON.Vector4(0,0, .5, .5); //top
  3. @jerome - thanks for letting me know! thats a pity you can't.. (doing it this way is going to be very confusing). Thanks for the link, I have started looking at these vector4 coordinates what are they calculated in? (or how can I translate that to pixels). for example: 0, 0, 1, 1 selects the entire image. uv[0] = new BABYLON.Vector4(0, 0, 1, 1); //botuv[1] = new BABYLON.Vector4(0, 0, 0, 0); //mid uv[2] = new BABYLON.Vector4(0, 0, 1, 1); //top I did see a example that used MultiMaterial so I was trying to apply it to a cylinder without luck - http://playground.babylonjs.com/#T40FK#15
  4. Thank you so much guys! exactly what I was after. I have been reading through the documentation (I am new to Babylon JS so bit confused here). All help is greatly appreciated. Can you assign a Texture directly into the uvFace parameter array (instead of using sprite sheet mapping) or is there another method? I would prefer to use separate textures for each segment. var materialface = new BABYLON.StandardMaterial("texture6", scene);materialface.diffuseTexture = new BABYLON.Texture("textures/misc.jpg", scene); var faceUV = [materialface, // bottom capmaterialface, // tube ring 1materialface // top cap]; I modified a playground here: http://playground.babylonjs.com/#T40FK#12
  5. Hi Everyone! My first post here Is there functionality when creating a Babylon Cylinder Mesh to add UV Mapping? for instance I am creating a cylinder object and I want to map a texture to both faces of the cylinder for example can I map a texture like this (or separate image files). Directly to a BABYLON Cylinder Mesh: cylinder = BABYLON.Mesh.CreateCylinder("cylinder1", 0.2, 3, 3, 100, 1, scene, false);Or will I need to create a Blender Model then export out a Babylon Mesh, reason why I want to keep with the builtin Mesh Cylinder lighting and fps speeds seem smoother and faster then importing a external .babylon/.obj mesh. I am sorry if this has been answered I have been searching for hours without any luck.