Posts: 2,404
Threads: 153
Joined: Jan 2005
Here is a body model simular to the body of the Lamborghini Countach.. Pretty cool with lighting.. (Lighting ripped from other OGL Demo's, tho I did change some of the setting to get a better effect, and, I placed all the glNormals.. :o )
No more reading, typing for me, here, look!
http://members.aol.com/rattrapmax6/fbfil...bo_ogl.exe
Enjoy!
Kevin ( x.t.r.GRAPHICS)
Posts: 1,688
Threads: 119
Joined: Jun 2003
very cool. Except it looks... plasticy.
Jumping Jahoolipers!
Posts: 489
Threads: 34
Joined: Jan 2005
nice!
...source?
ttp://m0n573r.afraid.org/
Quote:quote: "<+whtiger> you... you don't know which way the earth spins?" ... see... stupidity leads to reverence, reverence to shakiness, shakiness to... the dark side
...phear
Posts: 4,307
Threads: 63
Joined: May 2003
Posts: 2,404
Threads: 153
Joined: Jan 2005
@ Barok: Plastic? Opps, Lamborghinis are made of aluminum... >_< :lol:
@ Dumbledore: Bottom of this post...
@ TBBQ: Um... can you run the source? \/ \/ \/
Code: ' Lamborghini Model in Open GL
' Body Shell
' by Rattrap (Kevin)
'
' Lighting pulled from other codes.. Tho, I moved is possition
'
' Press <F5> ;)
option explicit
'$include: 'GL/gl.bi'
'$include: 'GL/glu.bi'
SCREEN 18, 32,,2
WINDOWTITLE "OpenGL Lamborghini Countach Body Shell..."
glViewport 0, 0, 640, 480
glMatrixMode GL_PROJECTION
glLoadIdentity
gluPerspective 45.0, 640.0/480.0, 0.1, 100.0
glMatrixMode GL_MODELVIEW
glLoadIdentity
glShadeModel GL_SMOOTH
glClearColor 0.0, 0.0, 0.0, 0.0
glClearDepth 1.0
glEnable GL_DEPTH_TEST
glDepthFunc GL_LEQUAL
glEnable GL_COLOR_MATERIAL
glEnable GL_NORMALIZE
glHint GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST
'lighting
'Materials (objects)
dim Mat_Ambient(3) as single
dim Mat_Specular(3) as single
dim Mat_Shininess(0) as single
Mat_Ambient(0) = 0.5
Mat_Ambient(1) = 0.5
Mat_Ambient(2) = 0.5
Mat_Ambient(3) = 1.0
Mat_Specular(0) = 1.0
Mat_Specular(1) = 1.0
Mat_Specular(2) = 1.0
Mat_Specular(3) = 1.0
Mat_Shininess(0) = 100.0
glMaterialfv GL_FRONT, GL_AMBIENT, @Mat_Ambient(0)
glMaterialfv GL_FRONT, GL_SPECULAR, @Mat_Specular(0)
glMaterialfv GL_FRONT, GL_SHININESS, @Mat_Shininess(0)
'Light
dim Light_Ambient(3) as single
dim Light_Diffuse(3) as single
dim Light_Specular(3) as single
dim Light_Position(3) as single
dim Model_Ambient(3) as single
Light_Ambient(0) = 0.0
Light_Ambient(1) = 0.5
Light_Ambient(2) = 0.2
Light_Ambient(3) = 0.0
Light_Diffuse(0) = 1.0
Light_Diffuse(1) = 0.5
Light_Diffuse(2) = 1.0
Light_Diffuse(3) = 1.0
Light_Specular(0) = 1.0
Light_Specular(1) = 1.0
Light_Specular(2) = 1.0
Light_Specular(3) = 1.0
Light_Position(0) = 0.0 'Source X
Light_Position(1) = 0.0 'Source Y
Light_Position(2) = 20.0'Source Z
Light_Position(3) = 0.0
Model_Ambient(0) = 0.5
Model_Ambient(1) = 0.5
Model_Ambient(2) = 0.5
Model_Ambient(3) = 1.0
'Load light parameters to GL states
glLightfv GL_LIGHT0, GL_AMBIENT, @Light_Ambient(0)
glLightfv GL_LIGHT0, GL_DIFFUSE, @Light_Diffuse(0)
glLightfv GL_LIGHT0, GL_SPECULAR, @Light_Specular(0)
glLightfv GL_LIGHT0, GL_POSITION, @Light_position(0)
glLightModelfv GL_LIGHT_MODEL_AMBIENT, @Model_Ambient(0)
'Enable light
glEnable GL_LIGHTING
glEnable GL_LIGHT0
glDepthFunc GL_LEQUAL
glEnable GL_DEPTH_TEST
'Main LOOP:
DIM rot as single
DIM T!
DO
T! = TIMER
glClear GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT
glLoadIdentity
'glRotatef rot, 1, 1, 1
glTranslatef 0, 0, -20
glRotatef rot, 1, 0, 0
glRotatef rot + 10, 0, 1, 0
glRotatef rot + 10, 0, 0, 1
glBegin GL_QUADS
'Roof
glColor3f (1.0, 0.0, 0.0)
glNormal3f (-2, 2, 2): glVertex3f (-2, 2, 2)
glNormal3f (2, 2, 2): glVertex3f (2, 2, 2)
glNormal3f (2, 2, -2): glVertex3f (2, 2, -2)
glNormal3f (-2, 2, -2): glVertex3f (-2, 2, -2)
'Windshield Post Left
'glColor3f (0.8, 0.0, 0.0)
glNormal3f (2, 2, 2): glVertex3f (2, 2, 2)
glNormal3f (3, 1, 4): glVertex3f (3, 1, 4)
glNormal3f (2.8, 1, 4): glVertex3f (2.8, 1, 4)
glNormal3f (1.8, 2, 2): glVertex3f (1.8, 2, 2)
'Windshield Post Right
'glColor3f (0.8, 0.0, 0.0)
glNormal3f (-2, 2, 2): glVertex3f (-2, 2, 2)
glNormal3f (-3, 1, 4): glVertex3f (-3, 1, 4)
glNormal3f (-2.8, 1, 4): glVertex3f (-2.8, 1, 4)
glNormal3f (-1.8, 2, 2): glVertex3f (-1.8, 2, 2)
'Door Left Part 1
glNormal3f (2, 2, 2): glVertex3f (2, 2, 2)
glNormal3f (2, 2, -2): glVertex3f (2, 2, -2)
glNormal3f (2.2, 1.8, -2): glVertex3f (2.2, 1.8, -2)
glNormal3f (2.2, 1.8, 2): glVertex3f (2.2, 1.8, 2)
'Part 2
glNormal3f (2, 2, 2): glVertex3f (2, 2, 2)
glNormal3f (3, 1, 4): glVertex3f (3, 1, 4)
glNormal3f (3, .8, 4): glVertex3f (3, .8, 4)
glNormal3f (2.2, 1.8, 2): glVertex3f (2.2, 1.8, 2)
'Part 3
glNormal3f (2, 2, -2): glVertex3f (2, 2, -2)
glNormal3f (2, 2, -1.8): glVertex3f (2, 2, -1.8)
glNormal3f (3, 1, -1.8): glVertex3f (3, 1, -1.8)
glNormal3f (3, 1, -2): glVertex3f (3, 1, -2)
'Part 4
glNormal3f (3, 1, 4): glVertex3f (3, 1, 4)
glNormal3f (3, 1, -2): glVertex3f (3, 1, -2)
glNormal3f (3, 0, -1): glVertex3f (3, 0, -1)
glNormal3f (3, 0, 3): glVertex3f (3, 0, 3)
'Door Right Part 1
glNormal3f (-2, 2, 2): glVertex3f (-2, 2, 2)
glNormal3f (-2, 2, -2): glVertex3f (-2, 2, -2)
glNormal3f (-2.2, 1.8, -2): glVertex3f (-2.2, 1.8, -2)
glNormal3f (-2.2, 1.8, 2): glVertex3f (-2.2, 1.8, 2)
'Part 2
glNormal3f (-2, 2, 2): glVertex3f (-2, 2, 2)
glNormal3f (-3, 1, 4): glVertex3f (-3, 1, 4)
glNormal3f (-3, .8, 4): glVertex3f (-3, .8, 4)
glNormal3f (-2.2, 1.8, 2): glVertex3f (-2.2, 1.8, 2)
'Part 3
glNormal3f (-2, 2, -2): glVertex3f (-2, 2, -2)
glNormal3f (-2, 2, -1.8): glVertex3f (-2, 2, -1.8)
glNormal3f (-3, 1, -1.8): glVertex3f (-3, 1, -1.8)
glNormal3f (-3, 1, -2): glVertex3f (-3, 1, -2)
'Part 4
glNormal3f (-3, 1, 4): glVertex3f (-3, 1, 4)
glNormal3f (-3, 1, -2): glVertex3f (-3, 1, -2)
glNormal3f (-3, 0, -1): glVertex3f (-3, 0, -1)
glNormal3f (-3, 0, 3): glVertex3f (-3, 0, 3)
'Left Fender, Top
glNormal3f (3, 1, 4): glVertex3f (3, 1, 4)
glNormal3f (2, .7, 5): glVertex3f (2, .7, 5)
glNormal3f (2, 0, 7): glVertex3f (2, 0, 7)
glNormal3f (3, 0, 7): glVertex3f (3, 0, 7)
'Right Fender, Top
glNormal3f (-3, 1, 4): glVertex3f (-3, 1, 4)
glNormal3f (-2, .7, 5): glVertex3f (-2, .7, 5)
glNormal3f (-2, 0, 7): glVertex3f (-2, 0, 7)
glNormal3f (-3, 0, 7): glVertex3f (-3, 0, 7)
'Left Fender, Side, Part 1 <<<<<
glNormal3f (3, 1, 4): glVertex3f (3, 1, 4)
glNormal3f (3, 0, 3): glVertex3f (3, 0, 3)
glNormal3f (3, 0, 3.5): glVertex3f (3, 0, 3.5)
glNormal3f (3, .85, 4.5): glVertex3f (3, .85, 4.5)
'Part 2
glNormal3f (3, 1, 4): glVertex3f (3, 1, 4)
glNormal3f (3, 0, 7): glVertex3f (3, 0, 7)
glNormal3f (3, -.2, 6.7): glVertex3f (3, -.2, 6.7)
glNormal3f (3, .8, 4): glVertex3f (3, .8, 4)
'Part 3
glNormal3f (3, .65, 5): glVertex3f (3, .65, 5)
glNormal3f (3, 0, 6.7): glVertex3f (3, 0, 6.7)
glNormal3f (3, -.5, 6.7): glVertex3f (3, -.5, 6.7)
glNormal3f (3, -.5, 5.5): glVertex3f (3, -.5, 5.5)
'Part 4
glNormal3f (3, 0, 3.5): glVertex3f (3, 0, 3.5)
glNormal3f (3, 0, -4): glVertex3f (3, 0, -4)
glNormal3f (3, -.5, -3.5): glVertex3f (3, -.5, -3.5)
glNormal3f (3, -.5, 3): glVertex3f (3, -.5, 3)
'Right Fender, Side, Part 1
glNormal3f (-3, 1, 4): glVertex3f (-3, 1, 4)
glNormal3f (-3, 0, 3): glVertex3f (-3, 0, 3)
glNormal3f (-3, 0, 3.5): glVertex3f (-3, 0, 3.5)
glNormal3f (-3, .85, 4.5): glVertex3f (-3, .85, 4.5)
'Part 2
glNormal3f (-3, 1, 4): glVertex3f (-3, 1, 4)
glNormal3f (-3, 0, 7): glVertex3f (-3, 0, 7)
glNormal3f (-3, -.2, 6.7): glVertex3f (-3, -.2, 6.7)
glNormal3f (-3, .8, 4): glVertex3f (-3, .8, 4)
'Part 3
glNormal3f (-3, .65, 5): glVertex3f (-3, .65, 5)
glNormal3f (-3, 0, 6.7): glVertex3f (-3, 0, 6.7)
glNormal3f (-3, -.5, 6.7): glVertex3f (-3, -.5, 6.7)
glNormal3f (-3, -.5, 5.5): glVertex3f (-3, -.5, 5.5)
'Part 4
glNormal3f (-3, 0, 3.5): glVertex3f (-3, 0, 3.5)
glNormal3f (-3, 0, -4): glVertex3f (-3, 0, -4)
glNormal3f (-3, -.5, -3.5): glVertex3f (-3, -.5, -3.5)
glNormal3f (-3, -.5, 3): glVertex3f (-3, -.5, 3)
'Hood
glNormal3f (2, .7, 5): glVertex3f (2, .7, 5)
glNormal3f (-2, .7, 5): glVertex3f (-2, .7, 5)
glNormal3f (-2, 0, 7): glVertex3f (-2, 0, 7)
glNormal3f (2, 0, 7): glVertex3f (2, 0, 7)
'Front Bumper.. Part 1
glNormal3f (3, 0, 7): glVertex3f (3, 0, 7)
glNormal3f (-3, 0, 7): glVertex3f (-3, 0, 7)
glNormal3f (-3, -.5, 6): glVertex3f (-3, -.5, 6)
glNormal3f (3, -.5, 6): glVertex3f (3, -.5, 6)
'Part 2
glNormal3f (3, -.5, 6.7): glVertex3f (3, -.5, 6.7)
glNormal3f (-3, -.5, 6.7): glVertex3f (-3, -.5, 6.7)
glNormal3f (-3, 0, 6.7): glVertex3f (-3, 0, 6.7)
glNormal3f (3, 0, 6.7): glVertex3f (3, 0, 6.7)
'Rear Top Left
glNormal3f (2, 2, -2): glVertex3f (2, 2, -2)
glNormal3f (2, 1, -7): glVertex3f (2, 1, -7)
glNormal3f (1.8, 1, -7): glVertex3f (1.8, 1, -7)
glNormal3f (1.5, 2, -2): glVertex3f (1.5, 2, -2)
'Rear Top Right
glNormal3f (-2, 2, -2): glVertex3f (-2, 2, -2)
glNormal3f (-2, 1, -7): glVertex3f (-2, 1, -7)
glNormal3f (-1.8, 1, -7): glVertex3f (-1.8, 1, -7)
glNormal3f (-1.5, 2, -2): glVertex3f (-1.5, 2, -2)
'Rear, inside Left top..
glNormal3f (1.5, 2, -2): glVertex3f (1.5, 2, -2)
glNormal3f (1.5, 1, -2): glVertex3f (1.5, 1, -2)
glNormal3f (1.8, 1, -7): glVertex3f (1.8, 1, -7)
glNormal3f (1.8, 1, -7): glVertex3f (1.8, 1, -7)
'Rear, inside Right top..
glNormal3f (-1.5, 2, -2): glVertex3f (-1.5, 2, -2)
glNormal3f (-1.5, 1, -2): glVertex3f (-1.5, 1, -2)
glNormal3f (-1.8, 1, -7): glVertex3f (-1.8, 1, -7)
glNormal3f (-1.8, 1, -7): glVertex3f (-1.8, 1, -7)
'Rear Hood
glNormal3f (1.5, 1, -2): glVertex3f (1.5, 1, -2)
glNormal3f (-1.5, 1, -2): glVertex3f (-1.5, 1, -2)
glNormal3f (-1.8, 1, -7): glVertex3f (-1.8, 1, -7)
glNormal3f (1.8, 1, -7): glVertex3f (1.8, 1, -7)
'Rear Fender Top Left..
glNormal3f (2, 2, -2): glVertex3f (2, 2, -2)
glNormal3f (2, 1, -7): glVertex3f (2, 1, -7)
glNormal3f (3, 0.7, -7): glVertex3f (3, 0.7, -7)
glNormal3f (3, 1, -2): glVertex3f (3, 1, -2)
'Rear Fender Top Right..
glNormal3f (-2, 2, -2): glVertex3f (-2, 2, -2)
glNormal3f (-2, 1, -7): glVertex3f (-2, 1, -7)
glNormal3f (-3, 0.7, -7): glVertex3f (-3, 0.7, -7)
glNormal3f (-3, 1, -2): glVertex3f (-3, 1, -2)
'Rear Fender Left Side
glNormal3f (3, 1, -2): glVertex3f (3, 1, -2)
glNormal3f (3, .85, -4.8): glVertex3f (3, .85, -4.8)
glNormal3f (3, 0, -4): glVertex3f (3, 0, -4)
glNormal3f (3, 0, -1): glVertex3f (3, 0, -1)
'Part 2
glNormal3f (3, .85, -4.8): glVertex3f (3, .85, -4.8)
glNormal3f (3, .7, -7): glVertex3f (3, .7, -7)
glNormal3f (3, .4, -7): glVertex3f (3, .4, -7)
glNormal3f (3, .4, -3): glVertex3f (3, .4, -3)
'Part 3
glNormal3f (3, .4, -7): glVertex3f (3, .4, -7)
glNormal3f (3, .75, -5): glVertex3f (3, .75, -5)
glNormal3f (3,0, -6): glVertex3f (3,0, -6)
glNormal3f (3, .4, -7): glVertex3f (3, .4, -7)
'Rear Fender Left Side
glNormal3f (-3, 1, -2): glVertex3f (-3, 1, -2)
glNormal3f (-3, .85, -4.8): glVertex3f (-3, .85, -4.8)
glNormal3f (-3, 0, -4): glVertex3f (-3, 0, -4)
glNormal3f (-3, 0, -1): glVertex3f (-3, 0, -1)
'Part 2
glNormal3f (-3, .85, -4.8): glVertex3f (-3, .85, -4.8)
glNormal3f (-3, .7, -7): glVertex3f (-3, .7, -7)
glNormal3f (-3, .4, -7): glVertex3f (-3, .4, -7)
glNormal3f (-3, .4, -3): glVertex3f (-3, .4, -3)
'Part 3
glNormal3f (-3, .4, -7): glVertex3f (-3, .4, -7)
glNormal3f (-3, .75, -5): glVertex3f (-3, .75, -5)
glNormal3f (-3,0, -6): glVertex3f (-3,0, -6)
glNormal3f (-3, .4, -7): glVertex3f (-3, .4, -7)
'Rear.. Part 1
glNormal3f (3, .7, -7): glVertex3f (3, .7, -7)
glNormal3f (2, 1, -7): glVertex3f (2, 1, -7)
glNormal3f (-2, 1, -7): glVertex3f (-2, 1, -7)
glNormal3f (-3, .7, -7): glVertex3f (-3, .7, -7)
'Part 2
glNormal3f (3, .7, -7): glVertex3f (3, .7, -7)
glNormal3f (-3, .7, -7): glVertex3f (-3, .7, -7)
glNormal3f (-3, .4, -7): glVertex3f (-3, .4, -7)
glNormal3f (3, .4, -7): glVertex3f (3, .4, -7)
'Part 3
glNormal3f (3, .4, -7): glVertex3f (3, .4, -7)
glNormal3f (-3, .4, -7): glVertex3f (-3, .4, -7)
glNormal3f (-2, .2, -7): glVertex3f (-2, .2, -7)
glNormal3f (2, .2, -7): glVertex3f (2, .2, -7)
glEnd
rot += 1 MOD 360
DO: LOOP UNTIL (TIMER - T!) >= .005
flip
LOOP UNTIL INKEY$ = CHR$(27)
Kevin ( x.t.r.GRAPHICS)
Posts: 3,288
Threads: 167
Joined: Nov 2001
you did the model by hand?!!!
:o
Posts: 979
Threads: 27
Joined: Aug 2001
It would appear so.
That's takes some guts.
Posts: 2,404
Threads: 153
Joined: Jan 2005
:???: Is there some other way?
Um, yeah, estimated and set the vertexs acordinly by hand... :roll: :wink: You'll notice it lacks some detail in places (e.i. Vents (door, over top rear fender, over rear wheel), lights, spoiler(Rear downforce wing), ect...) if you've looked at a real Countach ofcourse...
[asks self] Why didn't I do a Lamboghini LM002 or Hummer H1, that be less vertexs to detial, (Boxy vehicals) [/asks self] :rotfl:
That intrests me,.. if there simpler, more detailed ways, what are they?
Edit: Picture of Lamborghini Countach 1984 5000S :wink:
Kevin ( x.t.r.GRAPHICS)
Posts: 979
Threads: 27
Joined: Aug 2001
Doing the polys by hand is the equivalent of typing in individual PSETs to make a bitmap. Most people use a 3d drawing program and import the file.
Actually, most people that I know just use that damned teapot file that's been floating around the internet for a decade.
Posts: 2,404
Threads: 153
Joined: Jan 2005
Quote:Doing the polys by hand is the equivalent of typing in individual PSETs to make a bitmap. Most people use a 3d drawing program and import the file.
:lol: I used to do that when I started QB,.. PSET... PSET... :o PSET!!
Right.. I figured that much,.. I was thinking of something else,. but nm.. lol.. A editor sounds best, you know of any OGL related?
Kevin ( x.t.r.GRAPHICS)
|