Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+15 votes

I am struggling to export hexagons with OBJ file type, i wasnt sure if anyone had tips who succeeded in this.

asked in CSC305 Fall 2022 by (1 point)

1 Answer

+5 votes

Drawing it out really helps if you are struggling.

What I did was when I was calling the method, I looped through my list of coordinates and made the vertexes. This caused each vertex to be different than what I previously had for squares, so I drew it out using the new vertexes. I then had a helper method createSides(filewriter, sides) that would write out all the side rectangles for me, since no matter what shape it was they were rectangles. Then, all I had to do was draw the top and bottom seperately, making it easily extensible if needed.

Use this presentation for references
https://jamboard.google.com/d/1sTfxR45z95iPZUg4bqqE-UNuYchgD-64HuG_mkOr9uo/viewer?f=0

answered by (1 point)
...