-
-
Notifications
You must be signed in to change notification settings - Fork 218
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
Reimplement Projection
in rust
#143
Comments
Hello, i'm trying to crack this issue and found a problem. In static method |
What happens in that case (you happen to have a link to the source)? If it's not documented, I tend to consider it as an implementation detail that can change any moment 🤔 |
switch (p_eye) {
case 1: { // left eye
left = -xmax + frustumshift;
right = xmax + frustumshift;
modeltranslation = p_intraocular_dist / 2.0;
} break;
case 2: { // right eye
left = -xmax - frustumshift;
right = xmax - frustumshift;
modeltranslation = -p_intraocular_dist / 2.0;
} break;
default: { // mono, should give the same result as set_perspective(p_fovy_degrees,p_aspect,p_z_near,p_z_far,p_flip_fov)
left = -xmax;
right = xmax;
modeltranslation = 0.0;
} break;
} I guess it's fine to leave it as-is. But let's just say for consideration and completion. |
As they note here, this should be the same as |
The classes
Basis
,Transform2D
,Transform3D
, andProjection
, are all matrix-based classes. All of them exceptProjection
have most of their methods largely reimplemented in rust, mainly for performance reasons as crossing the ffi-boundary can be expensive.Projection
is mainly used as a 4x4 graphics projection matrix. So if you're familiar with graphics programming this would be a good thing to do.The projection impl should ideally look similar to
Basis
,Transform2D
, andTransform3D
.In addition, writing tests would be needed. Both unit tests for code that can be tested entirely in rust, but also integration tests. See here for an example of what integration tests could look like.
The original PR, #124, that added
Projection
and the other matrix-types to the bindings can also be useful to look at.For more information about
Projection
see:docs
source code
The text was updated successfully, but these errors were encountered: