{"action":"opened","issue":{"url":"https://api.github.com/repos/ggez/ggez/issues/149","repository_url":"https://api.github.com/repos/ggez/ggez","labels_url":"https://api.github.com/repos/ggez/ggez/issues/149/labels{/name}","comments_url":"https://api.github.com/repos/ggez/ggez/issues/149/comments","events_url":"https://api.github.com/repos/ggez/ggez/issues/149/events","html_url":"https://github.com/ggez/ggez/issues/149","id":257162595,"number":149,"title":"Better camera/transform controls?","user":{"login":"icefoxen","id":1335133,"avatar_url":"https://avatars3.githubusercontent.com/u/1335133?v=4","gravatar_id":"","url":"https://api.github.com/users/icefoxen","html_url":"https://github.com/icefoxen","followers_url":"https://api.github.com/users/icefoxen/followers","following_url":"https://api.github.com/users/icefoxen/following{/other_user}","gists_url":"https://api.github.com/users/icefoxen/gists{/gist_id}","starred_url":"https://api.github.com/users/icefoxen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/icefoxen/subscriptions","organizations_url":"https://api.github.com/users/icefoxen/orgs","repos_url":"https://api.github.com/users/icefoxen/repos","events_url":"https://api.github.com/users/icefoxen/events{/privacy}","received_events_url":"https://api.github.com/users/icefoxen/received_events","type":"User","site_admin":false},"labels":[{"id":658817040,"url":"https://api.github.com/repos/ggez/ggez/labels/*LESS%20EASY*","name":"*LESS EASY*","color":"c2e0c6","default":false},{"id":319009114,"url":"https://api.github.com/repos/ggez/ggez/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":507272273,"url":"https://api.github.com/repos/ggez/ggez/labels/[CODE]","name":"[CODE]","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/ggez/ggez/milestones/4","html_url":"https://github.com/ggez/ggez/milestone/4","labels_url":"https://api.github.com/repos/ggez/ggez/milestones/4/labels","id":2508463,"number":4,"title":"things I'm putting off","description":null,"creator":{"login":"icefoxen","id":1335133,"avatar_url":"https://avatars3.githubusercontent.com/u/1335133?v=4","gravatar_id":"","url":"https://api.github.com/users/icefoxen","html_url":"https://github.com/icefoxen","followers_url":"https://api.github.com/users/icefoxen/followers","following_url":"https://api.github.com/users/icefoxen/following{/other_user}","gists_url":"https://api.github.com/users/icefoxen/gists{/gist_id}","starred_url":"https://api.github.com/users/icefoxen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/icefoxen/subscriptions","organizations_url":"https://api.github.com/users/icefoxen/orgs","repos_url":"https://api.github.com/users/icefoxen/repos","events_url":"https://api.github.com/users/icefoxen/events{/privacy}","received_events_url":"https://api.github.com/users/icefoxen/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":0,"state":"open","created_at":"2017-05-08T21:27:31Z","updated_at":"2017-09-12T19:58:02Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2017-09-12T19:58:02Z","updated_at":"2017-09-12T19:58:02Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"See https://github.com/ggez/ggez/issues/135#issuecomment-328914981 for start of discussion.\r\n\r\nContinuation from IRC:\r\n\r\n```\r\n15:36 < termhn> Icefoz: what do you think about, instead of adding an actual camera, simply adding a view matrix to the Globals uniform and exposing it in the same way so that outside cameras can modify it... this way we aren't burdened by supporting an official camera but allow third party cameras to have tighter integration into the rendering pipeline than having to implement separate draw commands and just modify the parameters\r\n15:37 < Icefoz> That's a better idea.\r\n15:38 < termhn> I kinda like that idea, might write up a demo pr later, wouldn't be too hard I think...\r\n15:38 < Icefoz> Check out the Love2D docs but don't cleave to them too closely.\r\n15:38 < termhn> will do\r\n15:39 < Icefoz> Also I assume you are aware of https://github.com/ggez/ggez/blob/master/src/graphics/mod.rs#L513-L527\r\n15:40 < Ralith> not sure why a camera would involve \"separate draw commands\"\r\n15:40 < Ralith> separate from what?\r\n15:40 < termhn> ralith: not actual separate draw commands to the gpu\r\n15:41 < termhn> just a new trait that extends the current ggez \"Drawable\" abstraction\r\n15:42 < termhn> see: https://github.com/ggez/ggez-goodies/blob/master/src/camera.rs#L99\r\n15:42 < Icefoz> I still really think you're yak-shaving with the camera thing, termhn.\r\n15:42 < Icefoz> Do you have a particular use case you want to support?\r\n15:43 < termhn> https://github.com/ggez/ggez/issues/135#issuecomment-328914981\r\n15:44 < Icefoz> That's in depth enough I'll have to read it when I'm awake.\r\n15:44 < Icefoz> Which hasn't happened in like three weeks.\r\n15:44 < kvark> Ralith: I'm too lazy now to dig it up and point you more precisely, sorry\r\n15:47 < termhn> Icefoz: Basically, sprite batches don't integrate that well with an external camera because you have to add instances while thinking about default ggez screen/pixel coordinates and then place all other objects and move the batch as a whole thinking in camera world-space coordinates\r\n15:48 < Icefoz> I would assume you have to add your instances while thinking about the spritebatch's coordinate system, and then when you draw that gets transformed to the world's coordinate system.\r\n15:49 < Icefoz> I don't know if there's a better way of doing it but I agree it would be nice.\r\n15:49 < termhn> i suppose one solution to that would be like a \"CameraAdd\" trait that you would implement on SpriteBatch that would take an extra camera parameter and do conversion from there\r\n15:50 < Icefoz> I really doubt that the `CameraDraw` trait is a good idea, or whatever I called it.\r\n15:51 < Icefoz> It would be better to make everything use the same stupid drawing pipeline with the same state, and have a\r\n                transform stack or something as you suggested that gets multiplied by everything as it goes.\r\n15:51 < termhn> yea that's what I was thinking\r\n15:51 < Icefoz> You're probably right but I can't brain it right now.\r\n15:52 < termhn> Haha no probs\r\n\r\n```"}}
{"actor":{"display_login":"icefoxen"}}