Hersir

NullEngine Vector3.Project returns broken Vector3

Recommended Posts

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.