Add our own simple camera controller and use it
ClosedPublic

Authored by ervin on Aug 23 2018, 9:48 PM.

Details

Summary

It has a very simple behavior:

  • Up/down gets closer or away from the bed
  • Left/right rotates the camera around the view center
  • Left mouse button allows to change the view center by changing the orientation of the camera

Diff Detail

Repository
R231 Atelier
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ervin requested review of this revision.Aug 23 2018, 9:48 PM
ervin created this revision.
ervin set the repository for this revision to R231 Atelier.Aug 23 2018, 9:56 PM

This patch does not apply cleanly on master . I was not able to apply this diff using arcanist (base not in history) or by using the git raw diff. Please fix that so I can test this diff.

I would also like to see

  • mouse wheel to zoom
  • right click drag to rotate the view (around the center of the grid)
  • middle click drag to change move the camera

this would allow the user to control the 3d view completely with the mouse and be somewhat inline with how most 3d views control.

ervin added a comment.Aug 24 2018, 5:11 AM

It won't apply on master it depends on the previous ones, that comes from the way I upload the patches.

As for the extra features, this exercise is left to the reader. Those patches are the result of talking with Lays who told me you guys apparently needed some help to get started so I give you the basics but I'm unlikely to have the time to maintain the thing to take it in the directions you necessarily want.

I don't feel this mapping makes the view easy to use. This should behave like other 3d views so its intuitive for the user.

I'll need to test this patch. Probably in the weekend.

ervin added a comment.Aug 26 2018, 9:00 AM

I don't feel this mapping makes the view easy to use. This should behave like other 3d views so its intuitive for the user.

This is mainly emulating what I remember from what Lays showed him at Akademy. But really that was a quick pick so it's unlikely to be complete or anything. Again the purpose here is more to put in place the hooks you guys need to do something you like easily. Lays told me you were a bit lost on how to proceed there. To be honest I won't have the time to make a full featured camera controller so I went for just a couple of camera and mouse interactions so you see how it's done.

ervin updated this revision to Diff 40457.Aug 26 2018, 9:05 AM

Applying the style script

ervin added a comment.Aug 27 2018, 6:06 AM

Alright, what shall we do of that one? It's the last in the series being inconclusive. I think it's a keeper to be improved upon later. Please advise.

Alright, what shall we do of that one? It's the last in the series being inconclusive. I think it's a keeper to be improved upon later. Please advise.

Can we do this with a first person camera. Its very useful to be able to move the camera around. I did look a bit did not see a way to make this camera move (Im not really the best with the 3d code so could be wrong)

Well, first person camera is what was there before that patch and that Lays wanted to replace. :-)

And for the record, I tend to agree with her that first person camera controller (or even the orbit one) is not what you want for such an application and view.

It was not the camera mode that was needed to be changed it is only the user interaction that needed to change since they were not mapped to what most users who use 3d views expect

A camera where you can move the camera how ever I like is very helpful when checking if a print errors is a result of the printing or the slicing. Sometimes i need to look a very specific parts of the model to see these things. Also you nor i know what or where the user will be looking within the preview so giving them a simple rotate around the center and zoom in only towards center is not "powerful when needed".

ervin added a comment.Aug 27 2018, 3:05 PM

It was not the camera mode that was needed to be changed it is only the user interaction that needed to change since they were not mapped to what most users who use 3d views expect

Well, this *is* what the FirstPersonCameraController is.

A camera where you can move the camera how ever I like is very helpful when checking if a print errors is a result of the printing or the slicing. Sometimes i need to look a very specific parts of the model to see these things. Also you nor i know what or where the user will be looking within the preview so giving them a simple rotate around the center and zoom in only towards center is not "powerful when needed".

Well the one in that patch allows also to change the view center with the mouse.

And *AGAIN* I don't intend to complete the feature set of that one, it's left to you guys. I just provide the hooks so that the Atelier team can get started. It should be enough for you to decide where you want to push it in subsequent patches. It's not intended to be final, it's intended to be a very simple base to build upon.

I know this is ment to be a guide as to how we can do this (thank you for taking time todo this). Will we beable to use a first person camera as simply as changing the camera type if we decide to take that route or will this patch have to be completely redone?
@patrickelectric were you able to test this patch and what do u think?

ervin added a comment.Aug 28 2018, 6:02 AM

I know this is ment to be a guide as to how we can do this (thank you for taking time todo this). Will we beable to use a first person camera as simply as changing the camera type if we decide to take that route or will this patch have to be completely redone?

Well, if you want a first person camera controller, let's just not have that patch at all and use the stock FirstPersonCameraController. If you don't like how the stock FirstPersonCameraController behaves for some reason... it's all or nothing so you'd have to new one from scratch which would start with the current patch.

I hope this clarifies.

This revision is now accepted and ready to land.Aug 29 2018, 12:39 AM
This revision was automatically updated to reflect the committed changes.