- **Linear Algebra**
(*http://mymathforum.com/linear-algebra/*)

- - **Coordinate conversion**
(*http://mymathforum.com/linear-algebra/12867-coordinate-conversion.html*)

Coordinate conversionBeing new here, I wasn't sure where to post this, especially because I don't know what area of math the answer will lay in. Anyway, I am a 3D computer graphics designer with a programming problem that needs a mathematical solution. Basically, the problem I have is that I have a 2D planar object that is mapped in one coordinate system and needs to be converted to another. The exact numbers that are being dealt with can vary, because the shape will vary, but the new coordinate system is always the same. The new system can only have values between 0 and one. I will be dealing with the coordinates as (x,z) points, so that means that the target planar map will have x values from 0 to 1 and z values from 0 to 1. What I am doing is looping through all existing vertices, finding the min and max values of x and z. Then I subtract the min from the max to see if x or z contains the largest span of numbers. Here's a bit of code that should be simple enough to understand if you are at all familiar with simple programming languages. Code: `// nNumVertices contains the total number of x/z points we are dealing with` For example: (x,Z) Vartices to be converted: 203.58326721191406 / 133.94407653808594 646.3115234375 / 912.4210815429688 -901.4326171875 / 1094.460205078125 -1500.000244140625 / 1735.3692626953125 -1500 / 133.94407653808594 In this illustration, the black values are the current x/z values, the blue values are what I want to convert to. http://i7.photobucket.com/albums/y27...conversion.png Thanks, Beth |

Re: Coordinate conversionIt seems to me that you're looking for the following: transform(x,y) = ((x-minVertX)/maxVertValue, (y-minVertY)/maxVertValue) |

Re: Coordinate conversionQuote:
In the example, maxVertValue = 1735.3692626953125. I actually figured it out yesterday. But thanks for responding. :) |

All times are GMT -8. The time now is 12:18 PM. |

Copyright © 2018 My Math Forum. All rights reserved.