Hersir Posted February 14, 2018 Share Posted February 14, 2018 Hi, Tried to unit test my util function that involves Vector3.Project and it returns Vector3 with infinity in it. Doing something wrong? var engine = new NullEngine(); var scene = new Scene(engine); var camera = new ArcRotateCamera("camera", 0, 0, 0, Vector3.Zero(), scene); scene.render(); var pos = Vector3.Project( new Vector(0.5, 0.5, 0.5), Matrix.Identity(), scene.getTransformMatrix(), scene.activeCamera.viewport.toGlobal( engine.getRenderWidth(), engine.getRenderHeight(), ); // pos is Vector3 { x: Infinity, y: NaN, z: -Infinity } Using: 3.1.1 babylon Quote Link to comment Share on other sites More sharing options...
Guest Posted February 14, 2018 Share Posted February 14, 2018 I see Vector and not Vector3. Is it expected? Also your camera is at 0 looking at 0 which is not possible So you should set a radius of 1 or something at least Hersir 1 Quote Link to comment Share on other sites More sharing options...
Hersir Posted February 15, 2018 Author Share Posted February 15, 2018 Vector was typing isse here but radius helped thanks 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.