
Edge Flags
Posted Monday, 23 March, 2009 - 12:21 by Soundbomber inI am trying to utilise edge flags with my model (simple 3D I shape) in VB.NET, to eliminate some unwanted lines.
I am using "InterleavedArrayFormat.T2fC4fN3fV3f" and a boolean array containing the edge flag data. I enable the edge flag client state using :-
"oGL.EnableClientState(EnableCap.EdgeFlagArray)"
and (try) to populate it with :-
"oGL.EdgeFlagPointer(0, Me.oEdges)".
The edges only seem to change state (visible/not visible) in relation to the first boolean in the array (Me.oEdges(0)), all the other values seem to be ignored. So if for example Me.oEdges(0) is set to True and all the remaining values set to False then all edges are drawn. If however I set Me.oEdges(0) to False and all the remaining values to True, then no edges are drawn at all!
Anyone any ideas?


Comments
Re: Edge Flags
What happens if you change the edge flag array from Boolean() to Integer()?
Re: Edge Flags
Then I get a casting error when I call
oGL.EdgeFlagv(Me.oEdges)
(expectes boolean type for flag() argument)
Re: Edge Flags
Do I not need to call
oGL.EdgeFlagv(Me.oEdges)?
You will have to excuse my ignorance, I am still finding my way with OpenGL/OpenTK and there is scant info for VB programmers.
Anyway, tried without the above call and used integer values for the array but still nothing.
Re: Edge Flags
Ok, your initial code is correct (with boolean array) and the behaviour you are seeing is expected. Quoting from msdn:
Parameters
flag
Specifies a pointer to an array that contains a single Boolean element, which replaces the current edge flag value.
Only the first value is ever read from the array.
Re: Edge Flags
Surely not!
How then do we implement EdgeFlags with object arrays?
Why bother with an array if it only has one element?
Am I approaching this the wrong way?