Thread: Help with Dark GDK drawing a constellation (newbie)

  1. #1
    Registered User
    Join Date
    Sep 2010

    Help with Dark GDK drawing a constellation (newbie)

    Hey everyone.

    I'm really new to Dark GDK and C++ in general, but I'm learning.

    I was assigned by my friend who happens to be teaching me C++ in his free time to plot the Corona Australis constellation using the DbCircle (for the points of the stars), and the DbLine command to connect them.

    here is what I want to do:

    NOTE: Using the basic 640 x 480 window size
    #include "DarkGDK.h"

    Void DarkGDK()

    //Wait for key input with "Press any Key" message in the middle of the screen, so I guess that would be:

    dbText(320,240,"Press any key")? Or would I have to do something different?

    //Then I want to be able to have it draw all the points for Corona Australis on the 640 by 480 window after pressing a key. This is where I need help. I want to use dbCircle commands to draw the star points, and dbLine to connect them after a key press. I also want it to display a picture of saggitarius (Can be an JPG or GIF or any image type) in the background after the points have been plotted and connected with lines.

    I know this is a lot to ask but its a fairly simple program and Im wondering if anyone has free time if they could do it so I can work and learn off of your code?

    Here are links to the 2 images which are a picture of Corona Australis and the image of Sagittarius i wanted to use to place in the background on the 3rd key press.

    Corona Australis (the constellation)
    Imageshack - coronaaustralis.gif

    Imageshack - sagittarius2.gif

    So here is basically what I want it to do.

    Open a window 640x480,
    Display message in the middle of the screen that says "Press any Key to Continue"
    wait for key press

    Display all 8 points (Stars) of Corona Australis,

    wait for 2nd key press

    Connect all points together using dbLine

    wait for 3rd key press

    Display uploaded image of Sagittarius in the background behind Corona Australis.

    Thanks so much to anyone who can write this short program for me, I'm really trying to learn

  2. #2
    Bored Programmer
    Join Date
    Jul 2009
    Tomball, TX
    Quote Originally Posted by Noname37 View Post
    Thanks so much to anyone who can write this short program for me, I'm really trying to learn
    Definitely not trying to be rude here man, but thats not really how things work here. If you would like to post your code you have so far and tell us what is not working and how you tried to fix it, then you will find that information will be alot easier to come by. Most people here are working on their own projects or program at work etc, and to ask them to do your work for you when we've all done our fare share of programming is insulting to say the least. This board is about teaching and helping others learn. If you can demonstrate that you will learn when people give you information I'm sure you'll end up loving this board as a source. A few things you might want to do before posting.
    1. Read the forum rules.
    2. Read the link in the rules about how to ask a question the right way.
    3. Read the sticky on every message board that says "posting code" read this first.

    Come back here with some code you wrote to work on this problem, and I'd be more than happy to help you figure out why its not working or at least talk you through finding out how to verify your code yourself. Cheers ;o). And welcome to C++ hope you enjoy the learning process.
    Virtual reality hello world in html and javascript.
    Viewable with dodocase, google cardboard, OR, and other compatible VR gear.

  3. #3
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    I would create the primitive created by the connected points first. Reduce the scale of the primitive uniformly by 1 or 2 floats and draw that to the stencil buffer. Then draw the full primitive to the back buffer. End result: constellation connected by lines.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Dark gdk
    By Stonehambey in forum Game Programming
    Replies: 4
    Last Post: 08-21-2008, 05:20 PM