ozRocker Posted January 25, 2018 Share Posted January 25, 2018 Is it possible to make the environment texture follow the rotation of the camera? Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted January 25, 2018 Share Posted January 25, 2018 maybe by adding a UV offeset to the UVx of the environment. Quote Link to comment Share on other sites More sharing options...
ozRocker Posted January 25, 2018 Author Share Posted January 25, 2018 6 minutes ago, Pryme8 said: maybe by adding a UV offeset to the UVx of the environment. I can't find any UV offsets that affects the texture anywhere. I know environmentTexture has properties like wrapU and wrapV but they don't do anything. I tried using the helper like this: var helper = scene.createDefaultEnvironment(); and rotating that but it didn't make any difference Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted January 25, 2018 Share Posted January 25, 2018 Toss up a PG, I have a little bit of time before I gotta head out. I'm sure I can figure it out for you. Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted January 25, 2018 Share Posted January 25, 2018 http://www.babylonjs-playground.com/#QKEMLS Quote Link to comment Share on other sites More sharing options...
ozRocker Posted January 25, 2018 Author Share Posted January 25, 2018 On closer inspection, I think maybe the environment texture already does move with the camera but cos the lighting doesn't move with the camera it appears strange in my demo. I'll have a play with the lighting Pryme8 1 Quote Link to comment Share on other sites More sharing options...
ozRocker Posted January 25, 2018 Author Share Posted January 25, 2018 I'm using environementTexture like in this example https://www.babylonjs-playground.com/#Z1VL3V#4 It doesn't move with the skybox Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted January 25, 2018 Share Posted January 25, 2018 why not rotate the object not the environment? Quote Link to comment Share on other sites More sharing options...
ozRocker Posted January 25, 2018 Author Share Posted January 25, 2018 7 minutes ago, Pryme8 said: why not rotate the object not the environment? That's actually what I would prefer to do. It would solve the lighting and reflection issues. There's a lot of stuffing around to transfer camera movement to mesh though. Need to intercept controls, add inertia. I'm trying to make a simple demo that can be used as a tutorial. If there is a new, simple way to rotate mesh just like its a camera then I'll do that. Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted January 25, 2018 Share Posted January 25, 2018 https://www.babylonjs-playground.com/#QJE3YB#15 Im not sure if this method would work, but make a fake camera and then use that to set the position of the mesh.lookat()? I tried to do it here, but for some reason it seems to not work... ehh https://www.babylonjs-playground.com/#Z1VL3V#30 but that should be a hacky solution if I can get it working. Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted January 25, 2018 Share Posted January 25, 2018 and did you see: I know its not doing what you want, but I assume you are trying to put together something similar. Quote Link to comment Share on other sites More sharing options...
ozRocker Posted January 25, 2018 Author Share Posted January 25, 2018 9 minutes ago, Pryme8 said: and did you see: I'm having a look. I can't see where it allows manipulating mesh instead of camera. Am I missing something? Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted January 25, 2018 Share Posted January 25, 2018 No I was saying it does not do what you want but showing that other viewers do the same thing. If no one gives you a good solution, I’ll whip one up for you tommrow. Quote Link to comment Share on other sites More sharing options...
ozRocker Posted January 25, 2018 Author Share Posted January 25, 2018 28 minutes ago, Pryme8 said: No I was saying it does not do what you want but showing that other viewers do the same thing. If no one gives you a good solution, I’ll whip one up for you tommrow. Thanks mate. This is what I'm working on here http://preview.punkoffice.com/headmorph/ I'm trying to demonstrate the power of Babylon.js, how it can be used to make realistic facial expressions via morphing (vertex and textures) I think the eyes look strange cos when you rotate the reflection moves with it Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted January 25, 2018 Share Posted January 25, 2018 that happens in real life though. Quote Link to comment Share on other sites More sharing options...
ozRocker Posted January 25, 2018 Author Share Posted January 25, 2018 I mean the light source stays in the same place in relation to the head. When you're spinning a full scene around you can tell that the camera is spinning and it all makes sense but when there's one object on the screen it feels like the object is spinning, but then the light source and reflections make it feel a bit strange. 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.