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

Behind camera culling. #10

Open
volcoma opened this issue Sep 9, 2016 · 1 comment
Open

Behind camera culling. #10

volcoma opened this issue Sep 9, 2016 · 1 comment

Comments

@volcoma
Copy link

volcoma commented Sep 9, 2016

when behind the camera the gizmo is still rendered but wrong.
Add the following stuff to prevent this.

gContext.mCameraNearPlane.x = (gContext.mViewProjection.m[0][2]); gContext.mCameraNearPlane.y = (gContext.mViewProjection.m[1][2]); gContext.mCameraNearPlane.z = (gContext.mViewProjection.m[2][2]); gContext.mCameraNearPlane.w = (gContext.mViewProjection.m[3][2]);

and this

`void Manipulate(const float view, const float *projection, OPERATION operation, MODE mode, float *matrix, float *deltaMatrix)
{
ComputeContext(view, projection, matrix, mode);
// set delta to identity
if (deltaMatrix)
((matrix_t
)deltaMatrix)->SetToIdentity();

    vec_t cameraEyeToGizmo = Normalized(gContext.mModel.v.position - gContext.mCameraEye);
    if (cameraEyeToGizmo.Dot3(gContext.mCameraNearPlane) < 0)
        return;'
@CedricGuillemet
Copy link
Owner

Shame on me!
And same applies to the debug cube display. That will be fixed tomorrow. Thank you!

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