Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Gráficos
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

 
 
Herramientas Buscar en Tema Desplegado
  #12  
Antiguo 16-04-2013
Avatar de cesarsoftware
cesarsoftware cesarsoftware is offline
Miembro
 
Registrado: nov 2006
Posts: 241
Poder: 20
cesarsoftware Va por buen camino
Cita:
Empezado por blackx5n Ver Mensaje
1- Que version de delphi usaste para el codigo que posteaste
Delphi 2007
Cita:
Empezado por blackx5n Ver Mensaje
2- Tengo que tener instalado el opengl que version, o solo funciona con agregar al uses opengl.
solo agrega en el uses la unidad opengl
Cita:
Empezado por blackx5n Ver Mensaje
3- Que tipo de variables son h_DC y h_RC de el procedimiento glInicia;
Son handles, necesitas la unidad windows en el uses en mi caso son globales
h_DC : HDC; // handle del contexto del formulario
h_RC : HGLRC; // handle del contexto OpenGL
Cita:
Empezado por blackx5n Ver Mensaje
4- Que tipo de componente es el SpinZoom y SimCfg
SpinZoom: TUpDown;
SimCfg es un formulario que contiene la configuracion base
Cita:
Empezado por blackx5n Ver Mensaje
5- Que procedimiento es el glIniciaLuz();
Código Delphi [-]
procedure TfrmOpenGl.glIniciaLuz();
begin
  ambientLight[1] := 0.30;
  ambientLight[2] := 0.30;
  ambientLight[3] := 0.30;
  ambientLight[4] := 1.0;
  diffuseLight[1] := 0.1;
  diffuseLight[2] := 0.1;
  diffuseLight[3] := 0.1;
  diffuseLight[4] := 1.0;
  specularLight[1] := 0.5;
  specularLight[2] := 0.5;
  specularLight[3] := 0.5;
  specularLight[4] := 0.5;
  specurefLight[1] := 1.0;
  specurefLight[2] := 1.0;
  specurefLight[3] := 1.0;
  specurefLight[4] := 1.0;
  positionLight[1] := 0.0;
  positionLight[2] := 0.0;
  positionLight[3] := 150.0;
  positionLight[4] := 1.0;
end;

procedure TfrmOpenGl.glAjustaLuz();
begin
  // Definir Luz numero 0
  glLightModelfv(GL_LIGHT_MODEL_AMBIENT, @ambientLight);
  glLightfv(GL_LIGHT0, GL_AMBIENT, @ambientLight);       // luz ambiente
  glLightfv(GL_LIGHT0, GL_DIFFUSE, @diffuseLight);       // luz difusa
  glLightfv(GL_LIGHT0, GL_SPECULAR, @specularLight);     // luz especular
  glLightfv(GL_LIGHT0, GL_POSITION, @positionLight);     // posiciona la luz
  if SpinLuzFoco.Value <> 0 then begin
    glLightf(GL_LIGHT0, GL_SPOT_CUTOFF, 90);             // Angulo corte a 90º
    glLightf(GL_LIGHT0, GL_SPOT_EXPONENT, SpinLuzFoco.Value); // Foco brillante
  end else begin
    glLightf(GL_LIGHT0, GL_SPOT_CUTOFF, 180);              // Angulo corte a 180º
    glLightf(GL_LIGHT0, GL_SPOT_EXPONENT, 0);            // sin Foco
  end;
  glEnable(GL_LIGHT0);                                   // enciende luz nº 0
  glEnable(GL_COLOR_MATERIAL); // activa seguimiento del color
  glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);  // material sigue a color
  glMaterialfv(GL_FRONT, GL_SPECULAR, @specurefLight);// reflexivo especular
  glMaterial(GL_FRONT_AND_BACK, GL_SHININESS, 32);       // brillo moderado
end;

procedure TfrmOpenGl.BotonResetLuzClick(Sender: TObject);
begin
  glIniciaLuz();
  SpinLuzAmbiente.Value := 0;
end;

procedure TfrmOpenGl.SpinLuzAmbienteChange(Sender: TObject);
begin
  if EsNumero(SpinLuzAmbiente.Text) then begin
    ambientLight[1] := SpinLuzAmbiente.Value / 100;
    ambientLight[2] := SpinLuzAmbiente.Value / 100;
    ambientLight[3] := SpinLuzAmbiente.Value / 100;
    ambientLight[4] := 1.0;
    glDibuja();
  end;
end;
__________________
Disfruta de la vida ahora, vas a estar muerto mucho tiempo.
Responder Con Cita
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Opengl??? craven Gráficos 13 21-02-2007 17:25:29
opengl juanperalta Gráficos 4 11-09-2006 16:11:43
SIG opengl cecitt Gráficos 0 27-04-2005 16:47:58
OpenGL Sotrono Varios 2 26-02-2005 23:57:49
Opengl jose_2057111 Gráficos 0 14-12-2004 04:06:48


La franja horaria es GMT +2. Ahora son las 13:53:34.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi