Ameba Ownd

アプリで簡単、無料ホームページ作成

C program for polygon transformation

2022.01.19 01:55




















Forgot your password? Ask a Question. Please Sign up or sign in to vote. Below is the program which I am referring to, but it's not working. Copy Code. Posted Aug am rocking3. Updated Aug am Jochen Arndt. Add a Solution. Keith Barrow Aug am. Hi, Please update you question with either: 1. The compile time error message you are getting 2.


The runtime error message you are getting 3. The information you are putting in, your expected results and your actual results. People aren't likely to help unless you give this information as we don't know what the error is. Your setid matrix m function is essentially useless - it does not set the passed matrix to be a identity matrix - it passes the matrix by value - i. Look-up passing by reference, you'll either make the input var a pointer to a matrix or you'll make the var a matrix reference.


As it stands, try setting a matrix manually to contain junk data - print the contents of that matrix, pass it to setid, then print it again. See what I mean? Kenneth Haugland Aug am. Did you just repost the question, becouse I cant see that much difference except this said Polygon while the other said Triangle. Add your solution here. OK Paste as. Treat my content as plain text, not as HTML. Existing Members Sign in to your account. This email is in use.


Do you need your password? Submit your solution! The scaling factor s x , s y scales the object in X and Y direction respectively. P Scaling process: Note: If the scaling factor S is less than 1, then we reduce the size of the object. If the scaling factor S is greater than 1, then we increase size of the object.


Algorithm: 1. Make a 2x2 scaling matrix S as: S x 0 0 S y 2. For each point of the polygon. Draw the polygon using new coordinates. Below is C implementation:. Next 2D Transformation Rotation of objects.


Recommended Articles. Article Contributed By :. Easy Normal Medium Hard Expert. Writing code in comment? Please use ide. Load Comments.