Re: To OpenGL gurus.

new topic     » goto parent     » topic index » view thread      » older message » newer message

(38) Must have been a different version(?or a mistake) but it works ok, look
at my opengl demo in the recent contibutions.
The color changes because when it clips in interpolates the color funny
Strange, look at my demo, at the one with projection and compare them.

Daniel Kluss
----- Original Message ----- 
From: <1evan at sbcglobal.net>
To: "EUforum" <EUforum at topica.com>
Subject: Re: To OpenGL gurus.


>
>
> A clue perhaps?
> If I change the parameters in glTranslatef so the first two are a
> positive value less than one and the third parameter equals 0, I get
> what looks like a rapidly vertically scrolling triangle.  Weirder yet is
> the fact that as I change the parameters, the color of the triangle
changes.
> My glTranslatef definition is: glTranslatef = link_c_proc(gl,
> "glTranslatef", {C_FLOAT,C_FLOAT,C_FLOAT})
>
> Why are you using pfd = allocate(38)?  The PIXELFORMATDESCRIPTOR size is
> 40.  I tried 38 and it didn't make any difference though.
>
> xerox_irs at lvcm.com wrote:
>
> >
> >Hears mine, the window is made by win32lib
> >
> >atom window_dc,g_hRC
> >object junk
> >global procedure init_opengl_window(atom id)
> >        atom pfd,pixelformat
> >        window_dc=getDC(id)
> >        pfd=allocate(38)
> >        mem_set(pfd,0,38)
> >        poke4(pfd,38)--size
> >        poke4(pfd+2,1)--version
> >        poke4(pfd+4,or_all({PFD_DRAW_TO_WINDOW,  PFD_DOUBLEBUFFER ,
> >PFD_SUPPORT_OPENGL}))--flags
> >        poke(pfd+9,32)--color_bits
> >        poke(pfd+23,32)--depth_bits
> >        pixelformat=ChoosePixelFormat(window_dc,pfd)
> >        junk= SetPixelFormat(window_dc, pixelformat, pfd)
> >        g_hRC=wglCreateContext(window_dc)
> >        junk= wglMakeCurrent(window_dc, g_hRC)
> >end procedure
> >
> >
> >>    c_proc(glClearDepth,{1.0})
> >>    c_proc(gluPerspective,{45.0,width/height,0.1,100.0})
> >>
> >>
> >Increase Your ClearDepth to the last param of gluPerspective
> >and
> >
> >
> >>    c_proc(glTranslatef, {-1.5,0.0,-6.0})
> >>
> >>
> >May put the puts the
> >    c_proc(glVertex3f, {0.0,1.0,0.0})
> >
> >
> >>    c_proc(glColor3f, {0.0,1.0,0.0})
> >>    c_proc(glVertex3f, {-1.0,-1.0,0.0})
> >>    c_proc(glColor3f, {0.0,0.0,1.0})
> >>    c_proc(glVertex3f, {1.0,-1.0,0.0})
> >>
> >>
> >Completly Less than z(0.1) or greater that z(1.0)--which should be 100.0
> >
> >That will do, I think
> >Daniel Kluss
> >
> >----- Original Message ----- 
> >From: <1evan at sbcglobal.net>
> >To: "EUforum" <EUforum at topica.com>
> >Sent: Wednesday, May 28, 2003 12:41 PM
> >Subject: To OpenGL gurus.
> >
> >
> >>I have pared down my program to its bare essentials, moving constant and
> >>function definitions to include files.
> >>The problem I am having now is that no GL objects are drawn to the
> >>screen.  I'm guessing it has something to do with getting the rendering
> >>context or device context.  I really don't know.
> >>Any thoughts?
> >>
> >>include constants.ew  --for the windows functions and constants
> >>include GLfunc.ew  --for the OpenGL functions
> >>include GLconst.ew  --for the OpenGL constants
> >>
> >>atom glhRC, glhDC, hWnd, hInstance, ClassName, WindowRect
> >>sequence keys keys = repeat(0,256)  -- array to hold key presses
> >>
> >>integer active, retval
> >>active = TRUE
> >>glhRC = NULL
> >>glhDC = NULL
> >>hWnd = NULL
> >>hInstance = NULL
> >>
> >>procedure ReSizeGLScene(integer width, integer height)
> >>    if height = 0 then
> >>        height = 1  --prevent divide by 0
> >>    end if
> >>    c_proc(glViewport,{0,0,width,height})
> >>    c_proc(glMatrixMode,{GL_PROJECTION})
> >>    c_proc(glLoadIdentity,{})
> >>    c_proc(gluPerspective,{45.0,width/height,0.1,100.0})
> >>    c_proc(glMatrixMode,{GL_MODELVIEW})
> >>    c_proc(glLoadIdentity,{})
> >>end procedure
> >>
> >>procedure InitGL()
> >>    c_proc(glShadeModel,{GL_SMOOTH})
<snip>

>
>

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu