Now that we managed to install one more of our men into a project manager role, it seems to be the perfect time to protest loud again with picture, or not?


Now that we managed to install one more of our men into a project manager role, it seems to be the perfect time to protest loud again with picture, or not?

Anyway, look how many library units need to be included in Berlin for a simple orthographic camera. Only the 3 FMX units in folder fmx1 contain actual changes, the rest of the FMX units in folder fmx0 just happen to depend on changes to Types3D. And this is only for the Windows target.

Methods GetProjectionMatrix() and Pick() are virtual in my implementation. I also added a ViewType enum field and OnPick event to the Context. The Context needs info about ViewType to retrieve an appropriate projection matrix and to be able to delegate somewhere when picking. Note that the Context cannot access the Camera but the Camera has access to the Context. The Camera seems to be a good place to build the projection matrix, implement pick, and store a duplication of the current ViewType value. The camera needs to store duplicated info about the ViewType because the Context will be recreated when the user resizes the Viewport, and user code in OnResize will need to restore both ViewType and OnPick handler to the newly created Context.

Sounds too ugly to become mainstream? It probably does and I can somehow understand why Embarcadero so far refused to come up with a solution. Especially because my code has no design time support. But face it in 2016: The actual goal should be to allow the developer to implement orthographic projection without hacking into FMX library units. Don't say we have been fuzzy about the purpose: Ability to do orthographic projection without hacking library units is all we ask for. Marco blogged about access to private fields in helpers recently and this is my response, sort of.

I will be happy to provide the current test project in the picture to David the project manager, as a basis for possible internal discussion. I will not upload to Quality because of the many FMX units, because there are older entries already, and because I do not claim to have found the best possible solution.

Comments

  1. Ehm, David is actually a Product Manager, but anyway...

    ReplyDelete
  2. Since David is now a Project Manager, and he is familiar with the topic, I thought it might be a good idea to let him work on it now, it won't take long. Here at home I have just found out today that resizing the Viewport will make the Context loose info about the ViewType if not taken care of. This is a new twist to the existing test project, and I could help with an updated version to test against. David is the right person to implement and test it, that is what I am saying. Marco, please assign this task to him...

    ReplyDelete
  3. Hi Gustav Schubert Thanks for your comments. I'm a product manager, not project, so roughly the same role for C++Builder as Marco is for Delphi. (Marco was doing both before I was hired, very well.)

    I am familiar with the need for an orthographic projection - if you have a look at this QP entry, you might be surprised at who entered it :) https://quality.embarcadero.com/browse/RSP-9670

    I can't promise any particular feature will be added, especially not to the next release (it's in progress; I'm not going to arrive and immediately change its direction) but I can encourage you to vote for QPs. Voting shows how important an item is. While I'm happy for your faith in my coding abilities, I would not be coding this myself - my position is not as a programmer.

    ReplyDelete
  4. Ah ok, got it, Product Manager! This is good.

    ReplyDelete
  5. you could use Camera.Context.SetCameraAngelOfView and set it to a very low value, like 0.1. It's a workaround, but maybe still working for you.

    ReplyDelete
  6. No, small angle of view would not be good enough. I am creating larger images from tiles, these must stitch together exactly. Imagine that you want to demonstrate the symmetry of a model: if foreground does not match background – not good. Also I guess the matrix operations do not work well if angle of view approaches zero. It is a design flaw that I cannot setup the projection just by overriding a virtual method or two. Needs to be addressed. Have voted a long time ago. (I have unnecessary trouble with the FMX TStringGrid too, but will remain silent about that.)

    ReplyDelete
  7. I am down to one included FMX unit by now for the orthographic projection matrix. This time I attacked procedure TDX11Context.DoSetShaderVariable, the one that takes a Name and a Matrix. Just filter by Name and do stuff. It is all in the implementation section. Looking at Pick however, it would help if it was virtual by September. Don't tell the Product Manager.

    ReplyDelete

Post a Comment