Skip to content
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

Need computeScreenSpacePosition for polygon, possibly other primitives #746

Closed
mrmattf opened this issue May 7, 2013 · 5 comments
Closed

Comments

@mrmattf
Copy link
Contributor

mrmattf commented May 7, 2013

I'd like to know where the screen space position for a polygon is to tell me where to put a dom element.

@mramato
Copy link
Contributor

mramato commented May 7, 2013

Couldn't you just get the Polygon's extent and then get the screen space position of each corner?

@mrmattf
Copy link
Contributor Author

mrmattf commented May 7, 2013

possibly. having a function on the polygon,like the billboard and label have, would be a nice convenience. I'm picking objects and would just like to call computeScreenSpacePosition on the object itself and not have to query the type of object to figure out how to compute the screen space.

@mramato
Copy link
Contributor

mramato commented May 7, 2013

I'm not saying we shouldn't have a computeScreenSpaceExtent function on Polygon, it's useful and all primitives should have some sort of screen space method. However, I'm not sure computeScreenSpacePosition on every primitive is the way to go. For polygons, the only way a single position make any sense is if we computed a centroid to go a long with it, and on top of that, the centroid may not even be on the screen (at which point I'm not sure if we can actually compute it's position as a negative number or not). Lots of other primitive types would similarly not make sense for a single position in screen space.

That being said, we could ultimately move to computeScreenSpaceBounds which is generic across all primitives and returns a BoundingRectangle. For billboards, the rectangle would include the full bounds of the billboard and a center property would return the same value that computeScreenSpacePosition currently does.

Obviously I'm just brain storming, but I like my second idea since it could apply to all primitives.

bagnell added a commit that referenced this issue May 21, 2013
ComputeScreenSpacePosition for polygon. Temporary fix for issue #746.
@bagnell
Copy link
Contributor

bagnell commented May 30, 2013

@mrmattf Can we close this?

@mrmattf
Copy link
Contributor Author

mrmattf commented May 31, 2013

yep. thought this was closed already

@mrmattf mrmattf closed this as completed May 31, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants