reset password
Author Message
harry_520
Posts: 76
Posted 12:15 Jan 18, 2015 |

In the description, we are asked to have an array of Point3D storing 7 elements. I'm kind of confused. What is the purpose to have an array and what exactly are these 7 elements?

jpascua
Posts: 197
Posted 13:05 Jan 18, 2015 |

I'm confused with this exercise too. Is it possible to create a static array of structs without using pointers?

kknaur
Posts: 540
Posted 14:43 Jan 18, 2015 |

You can have a static array of Struts.  No pointers are necessary.  The assignment is to create the struct with the necessary member variables.  Then you are to create an array of 7 instances of the struct type and randomly populate each point with an x, y, and z value in the given range.

Then you test your points with the translate() and reflect() functions that you also need to add.

harry_520
Posts: 76
Posted 17:50 Jan 18, 2015 |

Does this mean that the output has 7 sets of different results for either translate or reflect?

Last edited by harry_520 at 23:26 Jan 18, 2015.
kknaur
Posts: 540
Posted 09:05 Jan 19, 2015 |

Yes, each point should be displayed when you are showing the output.

kevinmowers@yahoo.com
Posts: 49
Posted 20:21 Jan 19, 2015 |

Can anyone explain how translate works? does the user input an integer and x, y, and z is moved by that integer? I don't get x' = x + tx

kknaur
Posts: 540
Posted 07:47 Jan 20, 2015 |
kevinmowers@yahoo.com wrote:

Can anyone explain how translate works? does the user input an integer and x, y, and z is moved by that integer? I don't get x' = x + tx

tx, ty, tz are the translation values for each coordinate.  You ask the user for tx, ty, and tz and you update the coordinates accordingly.  Translation is how you move a point from one location to another.  x' = x + tx means x' is the updated value for x after taking the original value and adding the translation value.  NOTE: tx, ty, and tz can be any integer positive or negative.