Dear student,
Using PHP script, you can create a dynamic graph based on your database content.
But, you must download and understand more on JPGraph. What is JPGraph??
JpGraph is an Object-Oriented Graph creating library for PHP >= 5.1 The library is completely written in PHP and ready to be used in any PHP scripts (both CGI/APXS/CLI versions of PHP are supported).
You can download JPGraph at http://jpgraph.net/download/
You can see an example at http://jpgraph.net/features/gallery.php
Everything is about how you LOVE PROGRAMMING =)
Thursday, August 2, 2012
Tuesday, July 24, 2012
Discussion 1 - FP512 DIP5 (Group 1 and Group 2)
Please discuss and prepare the report based on discussion question in http://hafizahabdullah.blogspot.com/p/fp512web.html
Submit on Tuesday, 31 July 2012 before 5.00pm.
Tq =)
Submit on Tuesday, 31 July 2012 before 5.00pm.
Tq =)
Thursday, July 19, 2012
APPSERV installation Guide
APPSERV software package contains php programming, mysql database, apache server and phpmyadmin.
php programming - programming language
mysql - database
apache - web server
phpmyadmin - software to view 'live' mysql database structure
Same as XAMPP, WAMP, PHPTRIAD, WEBDEV....
Ask Mr. Google and Download by Yourself...
Download tutorial appserv installation guide [DOWNLOAD]
php programming - programming language
mysql - database
apache - web server
phpmyadmin - software to view 'live' mysql database structure
Same as XAMPP, WAMP, PHPTRIAD, WEBDEV....
Ask Mr. Google and Download by Yourself...
Download tutorial appserv installation guide [DOWNLOAD]
Friday, July 13, 2012
Semester June 2012
Assalamualaikum dan Salam Sejahtera
I'm delighted to welcome you all!
I'm delighted to welcome you all!
- FP512 Web Programming - Class DIP5
- F5224 Web Programming - Class QIP6
- FP201 Programming Fundamentals C++ - Class KHAS
- F5228 Project - Class DIP6C
Monday, March 5, 2012
For all my student...
Carilah seribu sahabat dalam pergaulan,
kerana seribu sahabat belumlah banyak.
Jauhilah seorang musuh, kerana musuh yang
seorang itu sudah lebih daripada banyak.
– Lukman Hakim
Thursday, July 7, 2011
Mapping Texture (Raw image) into Object
//fstream declaration
//glut header declaration
GLuint texture; //as global variable
//function only works for RAW format image
GLuint loadtex(const char *filename, int w, int h) //unasigned integer
{
GLuint tex;
FILE *file;
unsigned char *data;
file=fopen(filename,"rb");
if(file==NULL) return 0;
//preparation
data=(unsigned char *)malloc(w*h*3);
fread(data,w*h*3,1,file);
fclose(file);
//generate texture name
glGenTextures(1,&tex);
glBindTexture(GL_TEXTURE_2D,tex);
//texture environment
glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE);
//set texture environment parameters
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT);
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT);
//connect data to GL_TEXTURE_2D
glTexImage2D(GL_TEXTURE_2D,0,GL_RGB,w,h,0,GL_RGB,GL_UNSIGNED_BYTE,data);
free(data);
return tex;
}
void renderscene()
{
glClear(GL_COLOR_BUFFER_BIT);
glLoadIdentity();
gluLookAt(0,0,-3,0,0,0,0,1,0);
//enable
glEnable(GL_TEXTURE_2D); //activate the texture
glBindTexture(GL_TEXTURE_2D,texture); //bind the texture
//do something
glBegin(GL_QUADS);
glTexCoord2f(0,0);
glVertex2f(0,0);
glTexCoord2f(1,0);
glVertex2f(1,0);
glTexCoord2f(1,1);
glVertex2f(1,1);
glTexCoord2f(0,1);
glVertex2f(0,1);
glEnd();
glutSwapBuffers();
}
void reshape(int w, int h)
{
glViewport(0,0,(GLsizei)w,(GLsizei)h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(60,(GLfloat)w/(GLfloat)h,1.0,100.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
void keypress(unsigned char key, int x, int y)
{
if(key==27) exit(0);
}
int main(int argc, char **argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA);
glutInitWindowPosition(200,200);
glutInitWindowSize(500,500);
glutCreateWindow("Texture Example");
glutDisplayFunc(renderscene);
glutReshapeFunc(reshape);
glutKeyboardFunc(keypress);
texture=loadtex("texture.raw",256,256);
glutMainLoop();
glDeleteTextures(1,&texture); //reclean the memory and under glutMainLoop()
return(0);
}
//glut header declaration
GLuint texture; //as global variable
//function only works for RAW format image
GLuint loadtex(const char *filename, int w, int h) //unasigned integer
{
GLuint tex;
FILE *file;
unsigned char *data;
file=fopen(filename,"rb");
if(file==NULL) return 0;
//preparation
data=(unsigned char *)malloc(w*h*3);
fread(data,w*h*3,1,file);
fclose(file);
//generate texture name
glGenTextures(1,&tex);
glBindTexture(GL_TEXTURE_2D,tex);
//texture environment
glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE);
//set texture environment parameters
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT);
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT);
//connect data to GL_TEXTURE_2D
glTexImage2D(GL_TEXTURE_2D,0,GL_RGB,w,h,0,GL_RGB,GL_UNSIGNED_BYTE,data);
free(data);
return tex;
}
void renderscene()
{
glClear(GL_COLOR_BUFFER_BIT);
glLoadIdentity();
gluLookAt(0,0,-3,0,0,0,0,1,0);
//enable
glEnable(GL_TEXTURE_2D); //activate the texture
glBindTexture(GL_TEXTURE_2D,texture); //bind the texture
//do something
glBegin(GL_QUADS);
glTexCoord2f(0,0);
glVertex2f(0,0);
glTexCoord2f(1,0);
glVertex2f(1,0);
glTexCoord2f(1,1);
glVertex2f(1,1);
glTexCoord2f(0,1);
glVertex2f(0,1);
glEnd();
glutSwapBuffers();
}
void reshape(int w, int h)
{
glViewport(0,0,(GLsizei)w,(GLsizei)h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(60,(GLfloat)w/(GLfloat)h,1.0,100.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
void keypress(unsigned char key, int x, int y)
{
if(key==27) exit(0);
}
int main(int argc, char **argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA);
glutInitWindowPosition(200,200);
glutInitWindowSize(500,500);
glutCreateWindow("Texture Example");
glutDisplayFunc(renderscene);
glutReshapeFunc(reshape);
glutKeyboardFunc(keypress);
texture=loadtex("texture.raw",256,256);
glutMainLoop();
glDeleteTextures(1,&texture); //reclean the memory and under glutMainLoop()
return(0);
}
Wednesday, July 6, 2011
Create Text using Function
Just replace the ASCII code character codes with below function =) Simple and more effective!
void placetext(float x, float y, float z, void *font, char *string)
{
char *c;
glRasterPos3f(x,y,z);
for(c=string; *c!='\0'; c++)
{
glutBitmapCharacter(font,*c);
}
}
and replace your codes at display( ) function with;
placetext(0,0,0,GLUT_BITMAP_HELVETICA_18,"Hai Fiza!!");
void placetext(float x, float y, float z, void *font, char *string)
{
char *c;
glRasterPos3f(x,y,z);
for(c=string; *c!='\0'; c++)
{
glutBitmapCharacter(font,*c);
}
}
and replace your codes at display( ) function with;
placetext(0,0,0,GLUT_BITMAP_HELVETICA_18,"Hai Fiza!!");
Subscribe to:
Posts (Atom)
Question 1: Introduction to Variable
Based on code below, create a dynamic program that solve problem below: Source Code: #include <iostream> using na...
-
Comment and send your name, registration number and problem based task title in comment section Thank You =) Example: ABU BIN ALI (18D...
-
Dear students, How to love programming??? Learn from basic. Try to understand and learn each lines... Find the best way to fix an error a...
-
Dear students, Added information based on data communication. These topic briefly discusses the modes of channel operation namely, simple...
