Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

View3D project bug in shareContext #32

Open
tsmithf opened this issue Aug 7, 2019 · 2 comments
Open

View3D project bug in shareContext #32

tsmithf opened this issue Aug 7, 2019 · 2 comments

Comments

@tsmithf
Copy link

tsmithf commented Aug 7, 2019

As per this post on the Away3D forum...

Away3D Forum Post

Can this please get implemented in the openfl Away3D code, as project returns incorrect results when using shareContext otherwise.

@peteshand
Copy link

Based on that post it doesn't sound like the away3d source code was changed.. they're simply suggesting to set the viewport x and y:

v.x = (v.x + 1.0) * _width / 2.0 * (stage3DProxy.width / _width);
v.y = (v.y + 1.0) * _height / 2.0 * (stage3DProxy.height / _height);

@tsmithf
Copy link
Author

tsmithf commented Aug 8, 2019

I believe it may be referring to an amendment to the project function in containers\View3D.hx...

public function project(point3d:Vector3D):Vector3D
{
var v:Vector3D = _camera.project(point3d);

	if (!shareContext){
		v.x = (v.x + 1.0)*_globalWidth/2.0;
		v.y = (v.y + 1.0)*_globalHeight/2.0;
	}else{
		v.x = (v.x + 1.0) * _width / 2.0 * (stage3DProxy.width / _width);
		v.y = (v.y + 1.0) * _height / 2.0 * (stage3DProxy.height / _height);
	}
	return v;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants