Em Andamento

vb opengl rotation

im workin on a developing a control that displays terrains from DEM files. i am using VB6 and opengl. i am having problems rotating the objects in the scene. im not sure if i have set up the viewport and the viewvolume right. herez some of the code. plz help

" display routine "

wglMakeCurrent mlngPic1hDC,mlngWindowcontext

glEnable (GL_DEPTH_TEST)

glClearColor 0, 0, 0, 1

glClear clrColorBufferBit

glClear clrDepthBufferBit

glMatrixMode GL_MODELVIEW

glLoadIdentity

gluLookAt 0, 0, dblzcam, 0, 0, -(dblZMax - dblZMin) / 2, 0, 1, 0

glRotatef intRotate, 0, 1, 0

glTranslated -dblActualXMin + dblXMin, -dblActualYMin + dblYMin, dblZMin + (dblZMax - dblZMin) / 2

glPushMatrix

glEnable glcLighting

glEnable glcLight0

glEnable glcColorMaterial

glColorMaterial faceFrontAndBack, cmmAmbientAndDiffuse

glLineWidth 10

glColor3f 1, 0, 0

glBegin bmLines

glVertex3d dblActualXMin, dblActualYMin, -dblZMin - 10

glVertex3f dblActualXMin, dblActualYMax, -dblZMin - 10

glEnd

glColor3f 0, 1, 0

glBegin bmLines

glVertex3f dblActualXMin, dblActualYMin, -dblZMax - 10

glVertex3f dblActualXMin, dblActualYMin, -dblZMin - 10

glEnd

glcalllist 100 'has the terrain

glPopMatrix

glDisable (GL_DEPTH_TEST)

glFinish

SwapBuffers mlngPic1hDC

blnBusy = False

wglMakeCurrent mlngPic1hDC, 0

""viewvolume routine"

intRotate = 0

glMatrixMode GL_PROJECTION

glLoadIdentity

dblzcam = 0

glFrustum dblXMin, dblXMax, dblYMin, dblYMax, 1, (dblzmax-dblzmin)

glMatrixMode GL_MODELVIEW

glLoadIdentity

glShadeModel smSmooth

glEnable glcDepthTest

glEnable (glcBlend)

i dont think u have to worry bout the values of dblxmin..... what im doin is im settin a viewvolume n im drawin the axes and the terrain in the viewvolume, n im tryin to rotate it. i can move into the viewvolume using the glulookat command, but my glrotate just doesnt seem to work.

i have attached some part of the code and 2 snapshots. the first snapshot is when it initially loads the data from the file and the angle of rotation is 0, when i change it to 3 (angle is being changed in increments of 3) it lookz like the second snapshot. i hope this helps

## Deliverables

i just need to know where im going wrong.

## Platform

Windows 98 + , VB6, vb opengl api 1.2

Habilidades: Modelagem 3D, Engenharia, MySQL, PHP, Arquitetura de software, Teste de Software, Visual Basic

Ver mais: opengl help, opengl *, opengl api, opengl c++, opengl c, Drawin, c c opengl, axes, code opengl, rotation vb6, opengl vb6, opengl snapshot, routine visual basic, viewport, terrain opengl, code rotation, rotation windows, set rotating, scene opengl, opengl terrain, opengl objects, snapshot api, opengl php, workin, visual objects

Acerca do Empregador:
( 0 comentários ) United States

ID do Projeto: #3009622

Premiar a:

ShahSoftGames

See private message.

$12 USD em 1 dia
(5 Avaliações)
3.7

3 freelancers estão ofertando em média $17 para este trabalho

dnave

See private message.

$17 USD em 1 dia
(21 Comentários)
4.0
dnkvw

See private message.

$21.25 USD em 1 dia
(0 Comentários)
0.0