Polygon demo syntax question
MinimumWage
Posts: 72
Hello,
I'm hoping someone can answer what is probably a simple question. I'm working through the Hydra book and am dissecting the Polygon demo on pages 368-376. I don't quite understand the syntax given for the asteroid data structure. Specifically, if you look at the first two vertices:
The plot / line and·polar angle notation I understand, but I·can't figure out why·the X * 2 notation for the length is used here. At first I thought it was some kind of pseudo-real number workaround, but that doesn't make sense for the lengths of the vertices which were calculated at 5.65 and 4.47 from the plot on page 369.
The excerpt is actually from the example code on CD, the code in the book lists everything as an X * 8 length.
Any clarification would be greatly appreciated!
Mike
I'm hoping someone can answer what is probably a simple question. I'm working through the Hydra book and am dissecting the Polygon demo on pages 368-376. I don't quite understand the syntax given for the asteroid data structure. Specifically, if you look at the first two vertices:
word $4000+$2000*45/360 ' vertex 0 word 8*2 word $8000+$2000*63/360 ' vertex 1 word 4*2
The plot / line and·polar angle notation I understand, but I·can't figure out why·the X * 2 notation for the length is used here. At first I thought it was some kind of pseudo-real number workaround, but that doesn't make sense for the lengths of the vertices which were calculated at 5.65 and 4.47 from the plot on page 369.
The excerpt is actually from the example code on CD, the code in the book lists everything as an X * 8 length.
Any clarification would be greatly appreciated!
Mike
Comments
Andre'
Thanks, that makes sense. Did you also just experiment with different values to set the length? I was expecting to see something closer to the calculated values for the polar vectors from the graph drawing...
Mike
Andre'
I played around a bit last night with the vector demo just drawing triangles and other simple shapes and found that the length vectors didn't have to be exact. I could almost always round up or down to an integer value (from my plotted values)·and still not see any under- or overshoot onscreen at the vertices. It might show up worse on VGA, but for NTSC it looked fine.
Thanks again for all the help - working through the book has been a blast so far!
Mike