XTender Posted September 28, 2017 Share Posted September 28, 2017 I try to build an endless Track for a small Game and currently I stuck on an textureproblem. https://www.babylonjs-playground.com/index.html#9HEBCE#12 I use the CreateRibbon Method to build a lane out of an array. When I have 200 segments I remove the one at the top and move the camera temporary to the first one so currently it just looks like the lane is just waving but in reality the camera is moving (you can see it when you remove the camera position setting at the bottom.) I scale the texture to fit the whole mesh but then it looks like the track is not moving I tryed it it the vOffset but that didnt worket out. What I need is some kind of "material/shader" which projects a texture always in the same way, no mater where the mesh is in the world so it would look like the track moves. Or maybe someone have an another Idea how to achieve this. Thanks Quote Link to comment Share on other sites More sharing options...
RaananW Posted September 29, 2017 Share Posted September 29, 2017 Hi @XTender, I like the offset idea. Here is one way of doing it: https://www.babylonjs-playground.com/index.html#9HEBCE#25 Speed is the offset factor. Quote Link to comment Share on other sites More sharing options...
XTender Posted September 29, 2017 Author Share Posted September 29, 2017 The problem is just that it always move at the beginning when the camera didnt move. I continued the development a bit and that's what I got. https://www.babylonjs-playground.com/#9HEBCE#26 I dont need the offset anymore when I didnt "shorten" the track. Did Babylon also render polygons which are outside of the viewport? Quote Link to comment Share on other sites More sharing options...
RaananW Posted September 29, 2017 Share Posted September 29, 2017 Babylon doesn't render meshes that are 100% out of the viewport. Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted September 30, 2017 Share Posted September 30, 2017 http://www.babylonjs-playground.com/#1V70NA#17 maybe that sample can help or http://www.babylonjs-playground.com/#1V70NA#19 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.