404 Posted June 16, 2020 Share Posted June 16, 2020 I'm sure I'm missing something simple here, but I can't seem to make a rope with a repeating texture that isn't an aspect ratio of 1:1. Here's my sample code, based on the "Hello World" example: <!doctype html> <html> <head> <meta charset="utf-8"> <title>Hello World</title> </head> <script src="pixi.min.js"></script> <body> <script type="text/javascript"> let type = "WebGL" if(!PIXI.utils.isWebGLSupported()){ type = "canvas" } PIXI.utils.sayHello(type); // PixiJS 5.2.4 - ✰ WebGL ✰ http://www.pixijs.com/ ♥♥♥ const loader = PIXI.Loader.shared; let app = new PIXI.Application({width: 512, height: 512, antialias: true}); document.body.appendChild(app.view); loader.add("wall","uglywall2.png"); // 128px wide, 64px tall loader.load(setup); function setup() { let walltex = loader.resources.wall.texture; let tsprite = new PIXI.TilingSprite(walltex,400,64); tsprite.x = 50; tsprite.y = 50; app.stage.addChild(tsprite); let tropepoints = [new PIXI.Point(50,200), new PIXI.Point(450,200)]; let trope = new PIXI.SimpleRope(walltex,tropepoints, 1); walltex.baseTexture.wrapMode = PIXI.WRAP_MODES.REPEAT; app.stage.addChild(trope); } </script> </body> </html> I've attached a screenshot of the results. What I would expect is that the two objects appear identical, but the rope's texture gets "squashed" instead. What noob mistake am I making? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 16, 2020 Share Posted June 16, 2020 The only way to fix is to debug this , RopeGeometry, look at UV's its generating. Auto-scale is one of latest features of Rope, there weren't issues with it yet that we can learn on. Quote Link to comment Share on other sites More sharing options...
404 Posted June 17, 2020 Author Share Posted June 17, 2020 Ok - thanks. Good to know it's not just something dumb I've overlooked. I'm not terribly conversant with the details of RopeGeometry, but I'll start digging and see what I find. 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.