![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Buscar | Temas de Hoy | Marcar Foros Como Leídos |
![]() |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
|
|
#1
|
|||
|
|||
|
acabo de resolver el problema utilizando tglflattext
he aqui el codigo qu e tuve que utilizar para mantener el texto de frente a la camara. Código:
Camera.MoveAroundTarget(dy, dx); //despues de mover la camara
a:=tglcoordinates.Create(self);
flattext.Up.X:=0; flattext.Up.Y:=1; flattext.Up.Z:=0;
with Camera.Position do
begin
a.x:=((x)/sqrt(sqr(x)+sqr(z)+sqr(y)));
a.z:=((z)/sqrt(sqr(x)+sqr(z)+sqr(y)));
a.y:=((y)/sqrt(sqr(x)+sqr(z)+sqr(y)));
end;
flattext.Direction:=a;
sldos |
|
#2
|
|||
|
|||
|
Hola compañeros:
Estoy intentando crear dinámicamente un texto con GLScene pero este no se me visualiza por pantalla. El código es el sigiuente: Código:
//Creamos una clase que contiene los siguientes atributos IDGraph : TGLHUDText; //Texto GraphStoredBitmapFont: TGLStoredBitmapFont;//Biblioteca para el tratamiento de texto //En el constructor ponemos //Creamos el editor de texto self.GraphStoredBitmapFont:=TGLStoredBitmapFont.Create(self); self.GraphStoredBitmapFont.Font.Charset:=ANSI_CHARSET; self.GraphStoredBitmapFont.Font.Color:=clWhite; self.GraphStoredBitmapFont.Font.Height:=-11; self.GraphStoredBitmapFont.Font.Name:='Verdana'; self.GraphStoredBitmapFont.Font.Size:=8; self.GraphStoredBitmapFont.Font.Style:=[fsBold,fsItalic]; self.GraphStoredBitmapFont.Ranges[0].StartASCII:=#32; self.GraphStoredBitmapFont.Ranges[0].StartGlyphIdx:=0; self.GraphStoredBitmapFont.Ranges[0].StopASCII:='}'; //Creamos el texto self.IDGraph := TGLHUDText.Create(self.scene.Objects.AddNewChild(TGLHUDText)); self.IDGraph.Text:='Graph'; self.IDGraph.Position.SetPoint(0,0,0); self.IDGraph.Visible:=True; self.IDGraph.BitmapFont := self.GraphStoredBitmapFont; self.IDGraph.Alignment := taLeftJustify; self.IDGraph.Layout := tlTop; self.IDGraph.ModulateColor.AsWinColor:=clWhite; self.IDGraph.Scale.SetVector(1,1,1); self.IDGraph.Up.SetVector(0,1,0); Soy capaz de crear dinámicamente una tetera, planos, lineas, etc...pero el texto soy incapaz y no sé porqué, cualquier ayuda sería de agradecer. Sin más muchas gracias. Última edición por c4_esp_VR fecha: 07-04-2009 a las 12:16:13. |
|
#3
|
|||
|
|||
|
Hola compañeros:
He encontrado una solución, no es óptima, pero es una solución xD. En el evento AfterRender del GLSceneViewer hay que crear un canvas y pintar en este, de la forma sigiuente: Código:
procedure TForm1.GLSceneViewer2AfterRender(Sender: TObject);
var
canvas : TCanvas;
begin
canvas:=TCanvas.Create;
try
canvas.Handle:=GLSceneViewer2.RenderDC;
canvas.Brush.Style := bsClear;
canvas.Font.Name := 'Verdana';
canvas.Font.Color := clWhite;
canvas.TextOut(3, 3+canvas.TextHeight('A'), 'Texto');
end;
finally
canvas.Free;
end;
end;
![]() Un saludete y gracias. |
![]() |
| Herramientas | Buscar en Tema |
| Desplegado | |
|
|
Temas Similares
|
||||
| Tema | Autor | Foro | Respuestas | Último mensaje |
| Centralizar Textos | Paulao | Impresión | 0 | 02-04-2008 19:30:54 |
| GLScene? | PiornoCKA&G | Gráficos | 2 | 25-01-2007 10:09:37 |
| GlScene | Rabata | Gráficos | 2 | 12-06-2006 16:16:32 |
| GlScene??? | Rabata | Gráficos | 1 | 08-01-2005 21:46:46 |
| Procesador de textos | mahiques | Varios | 4 | 06-05-2003 10:16:48 |
|