From: Jürgen Gotschlich (juergen.gotschlich++at++dlr.de)
Date: 09/30/2002 06:00:06
Hi performers,
I have a very simple problem, but can't get it working. I want to create
a simple unidirectional light point. But in my application it is always
omnidirectional. I defined a normal to specify the direction, and also
set the PFLPS_SHAPE_MODE_UNI flag, but no matter which angle the eye
position is, I always see the same shape of the light point. No
difference from the front or back view.
Here is my code template:
...
//---- create variables from arena ----
nr = (int *)pfMalloc( sizeof(int), arena);
nr[0] = n;
Verts = (pfVec3 *)pfMalloc( nr[0]*sizeof(pfVec3), arena );
Cols = (pfVec4 *)pfMalloc( sizeof(pfVec4), arena );
Norms = (pfVec3 *)pfMalloc( sizeof(pfVec3), arena );
//---- create variables from arena ----
pfSetVec3( Verts[0], 0.0, 0.0, 10.0 );
pfSetVec4( Cols[0], 1.0, 0.0, 0.0, 1.0 );
pfSetVec3( Norms[0], 0.0, 0.0, 1.0 );
//---- create geostate and light point state ----
gst = pfNewGState(arena);
lps = pfNewLPState(arena);
pfGStateMode( gst, PFSTATE_ENLPOINTSTATE, 1 );
pfGStateAttr( gst, PFSTATE_LPOINTSTATE, lps);
//---- light points are unidirectional ----
pfLPStateMode( lps, PFLPS_DIR_MODE, PFLPS_DIR_MODE_ON );
pfLPStateMode( lps, PFLPS_SHAPE_MODE, PFLPS_SHAPE_MODE_UNI );
//---- create geoset ----
gset = pfNewGSet(arena);
pfGSetAttr( gset, PFGS_COLOR4, PFGS_OVERALL, Cols, NULL );
pfGSetAttr( gset, PFGS_COORD3, PFGS_PER_VERTEX, Verts, NULL );
pfGSetAttr( gset, PFGS_NORMAL3, PFGS_OVERALL, Norms, NULL );
pfGSetNumPrims( gset, 1 );
pfGSetPrimLengths( gset, nr );
pfGSetPrimType( gset, PFGS_POINTS );
pfGSetGState( gset, gst );
geode = pfNewGeode();
pfAddGSet( geode, gset );
...
Any ideas, hints ?
Thanks alot, Juergen
-- ________________________________________________________________________Jürgen Gotschlich email: juergen.gotschlich++at++dlr.de __/|_ Phone: +49(531)295-3248/2778 /_/_/_/ Fax : +49(531)295-2640 |/ DLR
Deutsches Zentrum für Luft-und Raumfahrt | German Aerospace Center Institut für Flugsystemtechnik | Inst. of Flight Research Abt. Flugsimulation | Flight Simulation Dep. Lilienthalplatz 7 | Lilienthalplatz 7 D-38108 Braunschweig | D-38108 Braunschweig, Germany ________________________________________________________________________
This archive was generated by hypermail 2b29 : Mon Sep 30 2002 - 05:59:49 PDT