Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: ConvertCoords from one view to another  (Read 4957 times)

0 Members and 1 Guest are viewing this topic.

gsaurus

  • Sr. Member
  • ****
  • Posts: 262
    • View Profile
    • Evolution Engine
ConvertCoords from one view to another
« on: September 25, 2010, 01:53:33 pm »
RenderTarget has a ConvertCoords to convert from target coordinates to View coordinates, but not the reverse operation, and I'm needing it.

I'm doing an editor which has a zoom functionality that zooms the entire view, so everything on that view get intentionally pixelized with close zoom. But I have to draw non pixelized objects too, for example a text legend over something. For that I use the default view, and need to convert some view coords to screen coords.

In general, we're talking about coords conversion between any two views. That may be a function of sf::View. Receiving the coords and a view,  converts those coords to the other view.
Pluma - Plug-in Management Framework

NoIdea

  • Full Member
  • ***
  • Posts: 149
    • View Profile
ConvertCoords from one view to another
« Reply #1 on: September 25, 2010, 03:00:52 pm »
We are having almost the same discussion on the french forum and the answer is at the moment : "there is no need for such a function". However, if Laurent is convinced there is a real need, he might add it. Good luck. Giving you the link to the french forum.

gsaurus

  • Sr. Member
  • ****
  • Posts: 262
    • View Profile
    • Evolution Engine
ConvertCoords from one view to another
« Reply #2 on: September 25, 2010, 04:17:30 pm »
Thank you.

I can give another example: imagine a game with two scene layers, each layer using a different view. For some reason the game designer may want to "translate" an object from the first layer to the second one, in a smooth way.
I already did it on the prototype of my engine, I converted the coordinates "manually". Eh, that was easy because layers hadn't different scale nor rotation. But if I considered all the views parameters I'd had problems on the conversion (I'm not that good with trigonometry :oops:).

Here's the example, characters swapping views:


A similar situation occurs on "Hercules Action Game":



Then, my current issue (the editor with zoomed view) sounds more common to me. I'm currently converting it manually, but without considering view rotation.
Pluma - Plug-in Management Framework

gsaurus

  • Sr. Member
  • ****
  • Posts: 262
    • View Profile
    • Evolution Engine
Re: ConvertCoords from one view to another
« Reply #3 on: November 04, 2010, 09:37:17 pm »
Quote from: "gsaurus"

In general, we're talking about coords conversion between any two views. That may be a function of sf::View. Receiving the coords and a view,  converts those coords to the other view.


Any news about this?
Pluma - Plug-in Management Framework

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
ConvertCoords from one view to another
« Reply #4 on: November 04, 2010, 09:47:48 pm »
No, sorry. I have so many things to do, and this one has very low priority :(
Laurent Gomila - SFML developer

gsaurus

  • Sr. Member
  • ****
  • Posts: 262
    • View Profile
    • Evolution Engine
ConvertCoords from one view to another
« Reply #5 on: November 05, 2010, 04:40:19 pm »
It's fine :wink:
Just wanted to know if it was considered or not
Pluma - Plug-in Management Framework