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
Transform matrix not changing for TranslateZ #398
Comments
Do you have some code to replicate this? |
@mikke89 I assume you mean Rml code. I have attached that. The only other thing I do is attach a breakpoint to the incoming SetTransform(const Rml::Matrix4f* transform) and view / print the results. |
Everything seems to be working fine here. The second submitted transform clearly has the z-translation, corresponding to the value set in the RML:
Did you check all the submitted transforms during a render frame? |
Did you try changing the translateZ value in the rml and seeing if the matrix value changed? I'll check my code again... But I wasn't getting that coming through. Is this what you're seeing in the SetTransform() . method ? |
Yes, and yes :) |
Thanks... Guess I'll have to deep dive into why I am getting different results. It could be something related to the C++ to C# bridging. |
@mikke89 So I figured out the transform issue. It was related to how I was reading it. However, in order to get this working correctly, I had to enable depth testing and depth writing, but when I do that, the z-index stuff seems to get messed up i.e. The buttons on the window are no longer displayed, since I suspect they are now behind the window. I tried adjusting the z-index, but that didn't make any difference. I think part of the problem is that the vertices don't have an z component set on them (only x and y). I am assuming the geometry is sorted by z-index, correct? And does the transform apply to any children i.e. if the transform is set on a window, that is also applicable to any children of that window? |
Draw calls are submitted in the order they should be rendered in. Depth testing and writing should not be necessary. The only exception would be if you need to support arbitrary overlapping transformations at the same z-index (we don't really care about this situation in the included backends), and then you would not be able to use transparency for this geometry. Yes, transforms apply to the element's children as well, any further transforms on the children are chained. |
I am trying to add support for transforms, and during testing it doesn't look like the transform matrix is changing then I use the "transform: translateZ(dp);" property.
I have the perspective setup on the parent element, and am trying to set the translateZ to different values, however the resulting transform matrix is always the same. Here are 4 results from setting translateZ to 0dp, 50dp, 100dp and 150dp (with perspective set to 500dp).
{{ {M11:1 M12:0 M13:0 M14:0} {M21:0 M22:1 M23:0 M24:0} {M31:-1.6 M32:-0.9 M33:1 M34:-0.002} {M41:0 M42:0 M43:0 M44:1} }}
{{ {M11:1 M12:0 M13:0 M14:0} {M21:0 M22:1 M23:0 M24:0} {M31:-1.6 M32:-0.9 M33:1 M34:-0.002} {M41:0 M42:0 M43:0 M44:1} }}
{{ {M11:1 M12:0 M13:0 M14:0} {M21:0 M22:1 M23:0 M24:0} {M31:-1.6 M32:-0.9 M33:1 M34:-0.002} {M41:0 M42:0 M43:0 M44:1} }}
{{ {M11:1 M12:0 M13:0 M14:0} {M21:0 M22:1 M23:0 M24:0} {M31:-1.6 M32:-0.9 M33:1 M34:-0.002} {M41:0 M42:0 M43:0 M44:1} }}
Any ideas as to why it's not changing? I don't see any Rml errors being generated.
The text was updated successfully, but these errors were encountered: