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 - lucas92

Pages: [1]
1
General / Isometric perspective to screen perspective
« on: December 27, 2013, 10:34:45 pm »
Hi, I have the following transform:

const static sf::Transform worldToScreen(sqrt(3) / sqrt(6), 0, -sqrt(3) / sqrt(6), 1 / sqrt(6), 2 / sqrt(6), 1 / sqrt(6), 0, 0, 1);

I see that the transform method of sf::Transform will always return a sf::Vector2f and take a sf::Vector2f as a parameter. Any way to make it return a sf::Vector3f and passing the parameter as a sf::Vector3f?

What I'd like to do is simply convert isometric world coordinates to screen coordinates by using this equation: [x',y',z']'=[T][x,y,z]' where x',y',z' are the screen coordinates (z' is ignored), T is the transformation matrix shown above and x,y,z are the world coordinates to convert.

Is this the correct way to use sf::Transforms?

Pages: [1]
anything