Jump to content
  • Advertisement
Sign in to follow this  
ramzi085

OpenGL openGL heart

This topic is 4680 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, can anybody tell me how can i draw a heart in openGL??? and i have another question can i take input from users in openGL not from cin statment ???

Share this post


Link to post
Share on other sites
Advertisement
1) What kind of heart?

2) OpenGL has no functions for user input. The windowing library you use to create the GL rendering context may have functions for accepting user input.

Share this post


Link to post
Share on other sites
Quote:
Original post by ramzi085
can anybody tell me how can i draw a heart in openGL???

Use pixels. I'm sorry, you'll have to be more specific.
Quote:
Original post by ramzi085
can i take input from users in openGL not from cin statment ???

OpenGL is a graphics API, it doesn't handle user input. Look into GLUT, DirectInput, or write a routine using something like the GetAsyncKeyState function.

Share this post


Link to post
Share on other sites
Then you could probably just use an drawing program to draw the heart on an image, save it to a file and load that file as a texture that you use on a quad.

Share this post


Link to post
Share on other sites
Get yourself some graph paper, draw the heart out by hand then translate the co-ordinates from the graph paper into OpenGL co-ordinates, plug them into a list and draw them.

Share this post


Link to post
Share on other sites
Computers draw curves by approximating them with a string of very small straight line segments. You can either go the graph paper method and just make sure you plot a vertex often enough that it looks smooth, or you could write yourself a routine that generates points on a curve (for example a section of a circle) using trigonometry or some kind of interpolation, then use that to generate your vertices.
For something quick and simple, the graph paper is your best bet - just use lots of vertices on the curves.

Share this post


Link to post
Share on other sites
Go to 3D Cafe, select "Free Stuff", agree to the license, select 3D Models, then Anatomy, then scoll down to heart.zip. You can click the little rectangle to the right of the filename to see what it looks like when rendered. One valantines appropriate heart, enjoy.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!