Click here to Skip to main content
15,881,866 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCombination C and OpenGL: Making a loop to draw circles [modified] Pin
Chidori-chan8-Dec-09 18:46
Chidori-chan8-Dec-09 18:46 
AnswerRe: Combination C and OpenGL: Making a loop to draw circles Pin
LunaticFringe8-Dec-09 19:43
LunaticFringe8-Dec-09 19:43 
GeneralRe: Combination C and OpenGL: Making a loop to draw circles Pin
Chidori-chan8-Dec-09 20:35
Chidori-chan8-Dec-09 20:35 
GeneralRe: Combination C and OpenGL: Making a loop to draw circles Pin
Cedric Moonen8-Dec-09 20:42
Cedric Moonen8-Dec-09 20:42 
GeneralRe: Combination C and OpenGL: Making a loop to draw circles Pin
Chidori-chan8-Dec-09 20:58
Chidori-chan8-Dec-09 20:58 
GeneralRe: Combination C and OpenGL: Making a loop to draw circles Pin
Tim Craig8-Dec-09 20:52
Tim Craig8-Dec-09 20:52 
GeneralRe: Combination C and OpenGL: Making a loop to draw circles [modified] Pin
Chidori-chan8-Dec-09 21:29
Chidori-chan8-Dec-09 21:29 
GeneralRe: Combination C and OpenGL: Making a loop to draw circles Pin
LunaticFringe9-Dec-09 3:42
LunaticFringe9-Dec-09 3:42 
Look at your code and then look at the picture.

You're translating the circles in 1 pixel increments (glTranslatef(o+28,455,1);, where o is incremented by 1 each pass through the for loop), and that's exactly what the image shows - the circles are drawn almost on top of one another, with each one 1 pixel further to the right than it's predecessor.

If you want the circles side by side, increase the offset between them.

And storing indices to the circles in an array will probably make processing the circles easier later, but it isn't absolutely necessary. Take it one step at a time - get your circles drawn where you want them first, then try optimizing the code (using an array, for instance) after you've gotten the basics working.

By the way, your code would be more readable, and you'd probably get better responses, if you straightened out the indenting.
GeneralRe: Combination C and OpenGL: Making a loop to draw circles Pin
Chidori-chan9-Dec-09 13:07
Chidori-chan9-Dec-09 13:07 
AnswerRe: Combination C and OpenGL: Making a loop to draw circles Pin
Cedric Moonen8-Dec-09 20:18
Cedric Moonen8-Dec-09 20:18 
QuestionWhy CDC::LineTo(pt) draw a line not include pt Pin
fitatc8-Dec-09 17:49
fitatc8-Dec-09 17:49 
AnswerRe: Why CDC::LineTo(pt) draw a line not include pt Pin
Richard MacCutchan8-Dec-09 22:06
mveRichard MacCutchan8-Dec-09 22:06 
GeneralRe: Why CDC::LineTo(pt) draw a line not include pt Pin
fitatc9-Dec-09 14:43
fitatc9-Dec-09 14:43 
GeneralRe: Why CDC::LineTo(pt) draw a line not include pt Pin
Richard MacCutchan9-Dec-09 23:18
mveRichard MacCutchan9-Dec-09 23:18 
GeneralRe: Why CDC::LineTo(pt) draw a line not include pt Pin
fitatc10-Dec-09 13:34
fitatc10-Dec-09 13:34 
QuestionDe Boor method to draw Bspline ?? Pin
a04.lqd8-Dec-09 16:54
a04.lqd8-Dec-09 16:54 
AnswerRe: De Boor method to draw Bspline ?? Pin
loyal ginger8-Dec-09 17:40
loyal ginger8-Dec-09 17:40 
GeneralCoding Team Needed in Advanced Artificial Intelligence Project-Project Vital Pin
Gabe Parmley8-Dec-09 15:54
Gabe Parmley8-Dec-09 15:54 
GeneralRe: Coding Team Needed in Advanced Artificial Intelligence Project-Project Vital Pin
LunaticFringe8-Dec-09 17:16
LunaticFringe8-Dec-09 17:16 
GeneralRe: Coding Team Needed in Advanced Artificial Intelligence Project-Project Vital Pin
Gabe Parmley8-Dec-09 17:19
Gabe Parmley8-Dec-09 17:19 
GeneralRe: Coding Team Needed in Advanced Artificial Intelligence Project-Project Vital Pin
Tim Craig8-Dec-09 20:59
Tim Craig8-Dec-09 20:59 
GeneralRe: Coding Team Needed in Advanced Artificial Intelligence Project-Project Vital Pin
Gabe Parmley9-Dec-09 4:59
Gabe Parmley9-Dec-09 4:59 
QuestionString from pointer to a char? Pin
o m n i8-Dec-09 14:45
o m n i8-Dec-09 14:45 
AnswerRe: String from pointer to a char? Pin
David Crow8-Dec-09 16:48
David Crow8-Dec-09 16:48 
AnswerRe: String from pointer to a char? Pin
Cedric Moonen8-Dec-09 20:32
Cedric Moonen8-Dec-09 20:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.