Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#207 TGLSceneBuffer.WorldToScreen

open
nobody
None
8
2012-10-04
2012-10-04
Anonymous
No

OS: Windows 7 64 (Ultimate)
Delphi: 2010 (14.0.3513.24210)
GLScene: GLScene_v1.1_March_2011_SVN_revision_5593
UNIT: GLScene.pas

// WorldToScreen
//

function TGLSceneBuffer.WorldToScreen(const aPoint: TAffineVector):
TAffineVector;
var
rslt: TVector;
begin
if Assigned(FCamera)
and Project(
VectorMake(aPoint),
RenderingContext.PipelineTransformation.ViewProjectionMatrix,
TVector4i(FViewPort),
rslt) then
Result := Vector3fMake(rslt)
else
Result := aPoint;
end;

When we create Form with GLSceneViewer at run-time, sometimes property
Buffer.RenderingContext = nil.
I propose to insert checking:

if Assigned(FCamera) and Assigned(Buffer.RenderingContext) then ...

Discussion


  • Anonymous
    2012-10-04

    • priority: 5 --> 8