Comments (4)
cc @nical
from euclid.
Hi @youngec, if you look at transform_point3d, euclid treats points as if they had their homogeneous coordinate equal to one, and then in vector_3d
a few lines below the computation corresponds to an homogeneous coordinate of zero, just like you said.
The issue is coming from the matrix in your test case: the translation components should be the members on the last row of the matrix and not the right column. You can try the same test again using the column_major notation:
let m: Transform3D<f64> = Transform3D::column_major(
1.0, 0.0, 0.0, 0.0,
0.0, 1.0, 0.0, 0.0,
0.0, 0.0, 1.0, -5.0,
0.0, 0.0, 0.0, 1.0
);
Or better even, use:
let m: Transform3D<f64> = Transform3D::create_translation(0.0, 0.0, -5.0);
...to avoid the classical confusion around transposition.
from euclid.
Yikes, this always happens to me; getting row- and column-major orders confused. Unfortunately, I have to rely on specifying all components of the matrix by hand, so your second suggestion will not work in my case. Thanks for clearing that up! You can close the issue.
from euclid.
Thanks for checking!
from euclid.
Related Issues (20)
- Scale::inverse negates the scale instead of inversing it. HOT 1
- Why cloned scale is used only for the first coordinate? HOT 1
- Rect::intersection should return None in the presence of NaN.
- (breaking change) self vs &self and non-copy scalars HOT 5
- Fails to compile with --no-default-features HOT 2
- Vector missing the Sum trait HOT 3
- Support for numeric casts through `az` crate HOT 2
- Constructors: splat, one HOT 3
- Component-wise multiplication for Vector2 HOT 2
- Component-wise division for Vector2 HOT 2
- Support for bytemuck Pod and Zeroable HOT 2
- Distinguish between orientation and rotation.
- missing `AddAssign` impl for `SideOffsets2D` HOT 1
- Add tags for releases on crates.io HOT 1
- Implement more `num-traits` (e.g. checked arithmetic) HOT 2
- Poor accuracy in Vector2D::angle_from_x_axis HOT 1
- Scale `mod`, `div` by scalar HOT 3
- Unresolved Import `num_traits::Euclid` HOT 3
- Box inclusive contains HOT 7
- Point2D/Point3D missing Add<Point2D<T, U>> impl HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from euclid.