Google Answers Logo
View Question
 
Q: I have 3 problems in C++ computer Graphics!! ( No Answer,   2 Comments )
Question  
Subject: I have 3 problems in C++ computer Graphics!!
Category: Computers > Programming
Asked by: leo_chris-ga
List Price: $50.50
Posted: 01 Mar 2005 09:02 PST
Expires: 31 Mar 2005 09:02 PST
Question ID: 482933
my problems is all about c++ in computer graphics, this is the following problems:
1. Create a program that plots random colors,lines and position
2. Create a program that plots random rectangles,colors and size
3. Create a program that plots random circles,colors and size

i have already the sample psedocode, just edit some parts of the program.

#define WORD unsigned short
#define DWORD unsigned long
#define VIDEO_SEG 0xA000

#include <stdio.h>
#include <dos.h>
#include <stdlib.h>
#include <conio.h>
#include <math.h>
#include <stdlib.h>
#include <time.h>   
#include <iostream.h>
#include <fstream.h>
#include <iomanip.h>



void GMode()
	{
	union REGS regs;
	regs.h.ah=0x00;
	regs.h.al=0x13;
	int86(0x10,&regs,&regs);
	}

void TMode()
	{
	union REGS regs;
	regs.h.ah=0x00;
	regs.h.al=0x03;
	int86(0x10,&regs,&regs);
	}

int Plot (int x,int y,int color)
	{
	union REGS regs;
	regs.h.ah=0x0C;
	regs.h.al=color;
	regs.x.cx=x;
	regs.x.dx=y;
	int86(0x10,&regs,&regs);
	return 0;
	}


void PutPixel( WORD x, WORD y, BYTE color )
{
   asm {
	
	mov di,VIDEO_SEG
	mov es,di
	mov ax,320
	mul [y]
	add ax,[x]
	mov di,ax
	mov al,[color]
	mov es:[di],al	
   }
}

void plotpixel(int x1,int x2, int y2, BYTE color)
{
int i,dx,dy,sdx,sdy,dxabs,dyabs,x,y,px,py,y1,vga;
dx=x2-x1;
dy=y2-y1;
dxabs=abs(dx);
dyabs=abs(dy);
sdx=sgn(dx);
sdy=sgn(dy);
x=dyabs>>1;
y=dyabs>>1;
px=x1;
py=y1;

VGA[(py<<8)+(py<<6)+px]=color;
if(dxabs>=dyabs)
{
for(i=0;i<dxabs;i++)
{
y+=dyabs;
if(y>=dxabs)
{
y-=dxabs;
py+=sdy;
}
px+=sdx;
put_pixel(px,py,color);
}
}
else
{
for(i=0;i<dyabs;i++)
{
x+=dxabs;
if(x>dyabs)
{
x-=dyabs;
px+=sdx;
}
py+=sdy;
plot_pixel(px,py,color);
}
}
}

 You can remake the program as long it prints what question is given
stated above. I ned this 3 program after 2 days plz help me and also
add comments in each lines in order for me to understand every lines.

 Advance ty il check this tommorow.
Answer  
There is no answer at this time.

Comments  
Subject: Re: I have 3 problems in C++ computer Graphics!!
From: studyloca-ga on 02 Mar 2005 21:20 PST
 
You asked best questions in this world, because i did this program
like 100 times becuase i m computer science best programmer i m a
student but i did this program and it will do your exact those 3
problems. but you know it's program file so here i want you to do do
tell me your e-mail address so i can send you program and also you can
give me your ph no it will help you alot to understand that program
but i don't want to submit online bcuz then someone will take that
program and chage something and submit to you so you will pay him so
trust me if you want program then give me e-mail address and ph no. so
i can talk about money to. becua i will take couple of $$ in advance.
Subject: Re: I have 3 problems in C++ computer Graphics!!
From: lordedarion-ga on 30 Mar 2005 17:45 PST
 
can you use opengl?
its very simple to do...

50 bucks is much money for such thing :P

i do it for you with full comments in c/c++ for 25...

patrick@moper.com.br

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy