Showing posts with label project. Show all posts
Showing posts with label project. Show all posts

Thursday, February 8, 2018

OpenGL: National Parliament of Bangladesh 3D Model

In my final year Graphics Lab, I implemented a 3D model of National Parliament of Bangladesh using OpenGL.

If you don't have glut installed in your codeblocks, then see this link :OpenGL installation


Features:

  • Day-night mode ( press 'n' OR 'N' )
  • Intensity changing ( press 'i' )
  • Fog mode ( press mouse right and left key )
  • Sun-moon show ( press 's' OR 'S' OR 'm' OR 'M' )
  • Light mode ( press 'l' )
  • Zoom mode ( press 'z' to zoom, 'x' to unzoom )
  • Text show ( press 't' to show text: "National Parliament of Bangladesh" )
  • Rotation mode ( press 'e' OR 'E' , 'r' OR 'R' to rotate camera )
  • Up-down mode ( press 'd' OR 'D' to down the camera, 'u' OR 'U' to uplift it )
  • Arrow keys to roam freely
Special Features:

  • Water flowing done by addinng 10 different images of a sample water flow. I used timer funtion to update the images (texture) and show them in output. Then it seems like the water is really moving
  • Same thing goes for flag moving
  • Also I used same technique to move trees [ though it doesn't look so good :( ]
Snapshots:





It's just a sample 3D model I implemented. Though it's really tough using OpenGL to draw as realistic as you want, but it is still fun to code :)
Here is the github link to the project. You can take a peek if you like.

link: https://github.com/sifatshishir/National-Parliament-3D-using-OpenGL

If you have problems running the project, you can follow these steps:
  • 1) create a project on codeblocks. 
  • 2) add all the header files and corresponding .cpp files, and non coding files such as .bmp, .bin, .txt and so on.
  • 3) Copy the texture code from main and bring to your project main.
  • 4) Run.
  • 5) If it works, good. else, go to 6
  • 6) left click on the project folder name which will on the left side under the project tab. click add files and select all of the files in 2.
  • 7) select in both debug and release and save.
  • 8) If it runs, good, else, go to 9.
  • 9) go to the project, then properties. from there, go to build target.
  • 10) change the execution working dir to your folder/bin/debug
  • 11) run
  • 12) if it works, fantastic, or else to go 13
  • 13) copy the .bmp .txt. bin files (non coding files) and place in your folder/bin/debug. delete all the .o from your folder/obj/debug and copy the .bmp .txt. bin files (non coding files).
  • 14) run



Wednesday, January 24, 2018

A client server multichat program for network programming

This was like my 4th year's network programming lab's project. The main task is to create a server that will help some clients to make communication with each other, like any social media services like Facebook, Whatsapp, Messenger etc.

Software Used: XAMPP server, NetBeans IDE.

Codes, sql files are given in the folder. Create a database in XAMPP named multichat. Then import the sql file. These are the instructions for the program: 
  • 1. Type 'create User_name Password' to create an account 
  • 2. Type 'login User_name Password' to login your account
  • 3. Type 'logout' to logout from your account 
  • 4. Type 'joinchatroom Chat_room_name' to join a chatroom 
  • 5. Type 'leavechatroom' to leave from your current chatroom
  • 6. Type 'showchatroom' to show all available chat rooms 
  • 7. Type 'showuser' to show all logged in user available
  • 8. Type 'showfriend' to show your friend list 
  • 9. Type 'showrequest' to show your pending friend request 
  • 10. Type 'connect Friend_name' to send friend request to your friend
  • 11. Type 'yes Friend_name' to accept a friend request 
  • 12. Type 'no Friend_name' to reject a friend request 
  • 13. Type 'message Friend_name Message' to send private message to your friend 
  • 14. Type anything else besides these commands to chat with your friends :)
At first, run the Xampp and start apache and sql connection, then run the server.java in the server project and after that we can run client.java as many ( I set at most 50 user ) times to create new client that can communicate.

Snapshots of the project

Firstly we will create a user using ‘create’ command like this:

Be careful about spacing. Ok, now login part:


The username is incorrect. Same thing goes for incorrect password too.

Now we are logged in. All the other commands are similar like this. Commands: 
  • 1. create: creates an user account in the database. 
  • 2. login: login command requires three space separated strings. If not found three strings, then it will show invalid command in the console. If the user is already logged in, then it will also show already logged in. Else command will check username and password from client table in the database and the user will be online. 
  • 3. logout: logout will sign out the user from the program.
  • 4. joinchatroom: The user will be able to join a chat room using this command as follows:
**If there are already people in a chat room, and they are online; if then a person joins that chat room, every other members of that room (currently logged in) will receive a message to welcome the new user 
  • 5. leavechatroom: User can leave his chat room. User can enter another chat room using joinchatroom command. If he is already in a chat room, then he will automatically be removed from previous room. Basically, a user can be inside one chat room at a time.
  • 6. showchatroom: This will show how many chat rooms are currently available which has at least one member. If there is no member in a chat room, that room will be deleted.

  • 7. showuser: Show all currently logged in user.
  • 8. showfriend: It will show the user’s friend list.
  • 9. showrequest: This will show pending friend request. 
  • 10. connect: Send a friend request to a user. If user doesn’t exist in the database, then it will show incorrect user.

** Also case like: sending friend request to own self, sending request to user that already been sent etc are also handled, Try typing command like these to check.
 
Ok, now if Sifat logs in, then he will automatically see pending requests from different users.
  • 11. yes & no: If Sifat type yes aladin, then he and aladin will become friend. If types no aladin, then aladin’s request will be rejected and aladin will be notified via a message. If aladin is not online, then the message will be pending, else aladin will receive rejection instantly.
  • 12. message: Type message aladin to send aladin a private message.

As aladin doesn’t have friend named Sifat, so private message won’t be possible. So let’s make friends:

Now, both of them can share private message. Suppose, aladin sent a message to Sifat. If Sifat is online, he will receive the message. If Sifat is offline, the message will be stored as pending message. When Sifat will log in, he will then receive all the pending messages from different users.

**If user is not in any chat room, all of his messages will be global, an everyone who are logged in globally will receive that message(Broadcast). Private message between friends is Unicast and inside chat room, messages will be counted as multicast (only user in the chat room will receive messages).

You can find my project here: https://github.com/sifatshishir/Client-Server-Multichat