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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - chugginwindex

Pages: [1]
1
Graphics / New to SFML, need help with World to Screen
« on: November 23, 2010, 07:01:51 pm »
Hey all,

I'm working on a orbital sim that lets you place stellar bodies with starting trajectories and have them be influenced realistically by gravity. I've got the basics done, but I'd like to have special overlays in the simulator for different effects such as tracing the orbits of the stars and showing the influence of gravity on the "fabric" of space. Anyways for these effects I really need to be able to convert my mouse / screen position(s) to real world coordinates so that I can do certain math with them such as seeing how strong the influence of gravity on a specific point is. the RenderTarget's ConvertCoords() function has already been a life saver, but now I'm in need of the opposite and haven't been able to find one. I saw a thread here a while back where someone said that the general consensus was that such a function was not necessary and therefore had very low priority for implementation...well I think I need it, and I'm wondering if anyone here may be able to help me figure one out. I tried taking a peek at the underlying code for ConvertCoords and just reversing the process (I remembered to multiple by the matrix of the view instead of the inverse matrix), but my values still got all out of wack when I tried to zoom in and out.

Has anyone else done something similar to this? I can't seem to figure it out for the life of me.

Oh and if it's relevant I'm building with SFML 2.0. Thanks in advance!

-Mike

Pages: [1]