Archive Pages Design\$type=blogging

Download the free source code for Torpedo OpenGL Code Example - a cg program on torpedo with a texturing of the body and the blades

Torpedo are basically self-propelled weapon cylindrical shaped (more like a cigar-shaped), which can be fired either underwater or above water fired from ship, submarine. It  designed to detonate either on contact with its target or in proximity to it.

Today we are presenting the OpenGL Code Example for Torpedo. We are going to draw Torpedo in Visula Studio C++ using opengl graphics API. This program is an enhancement of torpedo with a texturing of the body and the blades. This Program is written by Sumanta Guha. We are presenting the same version of code with no modification.

Understand the Problem

Every project we do, first we have to analyze the problem. So first we have know the structure of torpedo. After that we have do decide how the design can be drawn using the available objects in OpenGL API. We done with the design of Torpedo, we have give the motion with some keyword functions.

Design the structure of torpedo

Our Torpedo will have the following parts -
• A cylindrical body with hemi-spherical front face.
• 3 rotating blades attached to shaft at the back face.
• 3 curved fins attached in middle of body at equal distance.
There separate functions/routine defines of each of the objects for this OpenGL Code Example program. For draw hemi-sphere we have separate routine, which uses the latitudinal triangle strip, cos and sine function with proper logic. For blades the chessboard structure is used. While the whole body is give stripes with two different colors.

Bezire curves is used for the blades. The Control points for a propeller blade Bezier surface and Control points for the texture co-ordinates Bezier surface is defined. These are used for giving a textures to the blades and the body.

Interaction in the Program

Without having the user interaction in a program, it make the whole experience a dull one. The OpenGL Code Example program for Torpedo have the keyword interactions.

1. Press space to toggle between animation on and off.
2. Press the x, X, to rotate the viewpoint in the x-direction both forward and backward.
3. Press the y, Y, to rotate the viewpoint in the x-direction both forward and backward.
4. Press the z, Z, to rotate the viewpoint in the x-direction both forward and backward.
This is done by adding animation function to the display and giving the key their role for motion. You can download the whole Torpedo OpenGL Program Code with the link given below.

Name

3D Bi-Cycle 3D Game 3D Laptop 3D Objects 3D Projects 3D Zoo Algorithm Android Aquarium Bellman-Ford Algorithm BÃ©zier curves Block Breaker Blockshooting Bucket Sort C# Chess Clock Code Blocks Colors Complex Project Complex Projects Crab Pong Cross Zero Doll DSAV Escapa Fighter Jet First Come First Serve Flag Flag Hoisting Fluids Font Demo Games Gear Motion GlutDino Glutplane Graphics Editor iOS iPhone Java Java OpenGL Graphics Programming Light Torus Linked List Ludo Board Game Mancala board games Memory blocks game Memory Game Menu Mickey Mouse Minesweeper Miniature Steam Engine moth Motion Blur MoveLight moving car Moving Ship Multiplex Networking Based Project Nuclear Power Plant Olympic opengl c++ examples OpenGL ES OpenGL Programming OpenGL Tutorial Origami OS Based Projects Paint Paper Folding Particles Drop Path Finding ping pong Pong Game Project Report Projects Report Puzzles qix like Queuqe Random Flowing lines Ray Rigid Body Rings Robot sample c++ opengl code Screen Saver Screen Saver Ship Shadow Cube Shadowfun Ship Iceberg Simple Drawing Simple Haloed Lined Wireframe Simple Move Light Simple Project Simulation SNAKE XENZIA GAME Solar system Sorting Space Invaders Sphere Spot Light Swing Stack Stars Taj Mahal The Edge Game Tic Tac Toe Tower of Hanoi Traffic Signal Transformation Triangular Animation Trippy Tutorial water ripple effects Whirlpool
false
ltr
item
OpenGL Projects: Torpedo OpenGL Code Example
Torpedo OpenGL Code Example
Download the free source code for Torpedo OpenGL Code Example - a cg program on torpedo with a texturing of the body and the blades
http://3.bp.blogspot.com/-KrBImxCAt7c/VqeDrof2h4I/AAAAAAAAHik/PLqGkv5BPZw/s400/Torpedo%2BOpenGL%2BCode%2BExample.JPG
http://3.bp.blogspot.com/-KrBImxCAt7c/VqeDrof2h4I/AAAAAAAAHik/PLqGkv5BPZw/s72-c/Torpedo%2BOpenGL%2BCode%2BExample.JPG
OpenGL Projects
http://www.openglprojects.in/2016/01/torpedo-opengl-code-example.html
http://www.openglprojects.in/
http://www.openglprojects.in/
http://www.openglprojects.in/2016/01/torpedo-opengl-code-example.html
true
2020194800836807725
UTF-8