graphics in c++

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Oct 2007
Posts: 6
Reputation: akame is an unknown quantity at this point 
Solved Threads: 0
akame akame is offline Offline
Newbie Poster

graphics in c++

 
0
  #1
Oct 14th, 2007
i plotted a parabola....when i try to join the previous pixel with the next pixel,it does not come out to be straight???cant we draw a smooth curve....joing pixels???if no then why???
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 749
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: graphics in c++

 
0
  #2
Oct 14th, 2007
Well until you post code, and tell us which OS/Compiler/Graphics library you're using (not that I'm expecting it to be anything other than fossil TurboC and BGI), don't expect an answer.

The way to make the curve appear smoother is to reduce the interval between sample points.
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 6
Reputation: akame is an unknown quantity at this point 
Solved Threads: 0
akame akame is offline Offline
Newbie Poster

Re: graphics in c++

 
0
  #3
Oct 14th, 2007
well I AM USIING TURBO C++,OS IS WINDOWS XP PROFESSIONAL,AND I AM USING PUTPIXEL COMMAND...WE CANT REDUCE THE THE DISTANCE BETWEEN THE POINTS BECAUSE PUTPIXEL COMMAND ACCEPTS ONLY INTEGER VALUES,SO IF A FLOATING POINT VALUE WILL BE USED IT WILL BE TRUNCATED...EG..PUTPIXEL(31,50,2) 31 IS THE X COORDIANTE,50 =Y COORDINATE, 2 IS THE COLOR OF TEH PIXEL...
IS SAME AS PUTPIXEL(31.4,50.3,2);
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 6
Reputation: akame is an unknown quantity at this point 
Solved Threads: 0
akame akame is offline Offline
Newbie Poster

Re: graphics in c++

 
0
  #4
Oct 14th, 2007
and i am using graphics.h
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 749
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: graphics in c++

 
0
  #5
Oct 14th, 2007
Thanks for yelling at us
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 6
Reputation: akame is an unknown quantity at this point 
Solved Threads: 0
akame akame is offline Offline
Newbie Poster

Re: graphics in c++

 
0
  #6
Oct 14th, 2007
well it is better if u can give straight 4wd answers...salem....we are here to discuss the querys...
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,652
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 722
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: graphics in c++

 
1
  #7
Oct 14th, 2007
>well it is better if u can give straight 4wd answers...
Salem's answer not only was as thorough as possible given the complete lack of information you provided, it was also useful in other ways. So drop the attitude.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 749
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: graphics in c++

 
0
  #8
Oct 14th, 2007
OK, so you've recognised that pixel plotting is integer based, so what's the problem?

To draw a pixel at a fractional position, you have to resort to Anti-aliasing.

Now, if you were using a modern compiler, with a modern graphics library (and not that stone-age fossil everyone seems to love for some unknown reason), then you might be able to get some built-in support. But as it is, expect to get down to doing some serious maths to make your images look good.

The first problem you'll come across is the utter lack of a decent colour space in your fossil graphics library. AA works best on say an 8:8:8 colour space, but with something crude like 3:3:2 or even a 256-palette, your options are severely limited.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC