|
From: Chetan D. <che...@as...> - 2003-11-07 14:09:13
|
Hi,
YES, I am not interested in setting depth of the child widgets. BUT,
for setting 'layer' or the minX value of the child widget, there should be,
some non-zero mGLDepth for the parent.
e.g.
Using setRelativeGeometry, we set Child.mPosition as (0.0, 0.0, 0.5)
i.e. the 'layer' at 0.5z relative to the parent.
Now when the layoutInGLVolume(..) is called for the parent, parent calls
Child.layoutInGLVolume(..) using its (parent's) updated mGLPosition and
mGLWidth,
mGLHeight and mGLDepth.
Inside the child, child's x, y and 'layer' i.e. z are calculated based
on parent's minX, minY, minZ
AND mGLWidth/Height/Depth, sent in using layoutInGLVolume().
/
void GmDrawable::layoutInGLVolume(float minX, float minY, float minZ,
float width, float height, float depth)
{
// (minX, minY, minZ) Parent container x, y and z base position
float dX, dY, dZ; // Drawable's x, y and z base position
mPosition.getXYZ(dX, dY, dZ);
mGLPosition.setXYZ(minX + (width * dX),
minY + (height * dY),
minZ + (depth * dZ));
mGLWidth = width * mWidth;
mGLHeight = height * mHeight;
mGLDepth = depth * mDepth;
setDisplayListValid(false);
}
/
So, If Parent.mDepth = 0.0, by default, Parent.mGLDepth will also be 0.0
unless mDepth is set to 1.0.
If Parent.mGLDepth = 0.0, 'depth' in the above code will be 0.0, and z
value for the child will be incorrect.
- Chetan
David Longley wrote:
>Chetan,
>
>If you have 3 child widgets inside a container, set their layers, not their
>depth. 2d widgets don't have depth, but they are placed on different layers.
>
>Just think of it like this -- a 2d widget is drawn on a plane (layer) ... but
>a plane is in 3d space. You tell the widget which plane to draw on... you
>don't make it take up more than 1 plane.
>
>-Dave
>
>On Thursday 06 November 2003 03:35 pm, Chetan Dandekar wrote:
>
>
>>The 'layer' is ultimately the z value.
>>I have 3 children ( I mean children widgets :-P) inside a container,
>>I set their relative geometries such that they get spread out, over a depth
>>(range of z values determined by the mGLDepth of the parent.)
>>
>>Now, by default mDepth of the parent is 0.0. So, unless I explicitly set
>>its mDepth = 1.0, its mGLDepth will also remain 0.0. But in case, of mWidth
>>mHeight, they are 1.0 by default. mDepth should be 1.0 by default in the
>>same way.
>>
>>- Chetan
>>
>>Dave Longley wrote:
>>
>>
>>>Chetan,
>>>
>>>Setting depth should have nothing to do with overlapping children. The
>>>layer that the children are rendered in does. We just don't handle
>>>layering properly yet.
>>>
>>>-Dave
>>>
>>>----- Original Message -----
>>>
>>>
>>From: "Chetan Dandekar" <che...@as...>
>>
>>
>>
>>>To: "glam-devel" <gla...@li...>
>>>Sent: Wednesday, November 05, 2003 5:41 PM
>>>Subject: Re: [glam-devel] small but imp. correction in GmDrawable
>>>constructor
>>>
>>>
>>>
>>>>Well, what we call 2d in glam in not only 2d! It also includes 3d
>>>>orthographic projection.
>>>>This is useful when the children widgets need to overlap each other and
>>>>still function
>>>>correctly, independent of the rendering order.
>>>>
>>>>I am using overlapping childrens. So, for that I have to explicitly set
>>>>mDepth as 1.0 whereas
>>>>mWidth and mHeight are 1.0 by default, which is not consistent.
>>>>
>>>>- Chetan
>>>>
>>>>David Longley wrote:
>>>>
>>>>
>>>>>Chetan,
>>>>>
>>>>>Depth is set correctly. In a 2d application (default), widgets have no
>>>>>
>>>>>
>>>depth.
>>>
>>>
>>>
>>>>>-Dave
>>>>>
>>>>>
>>>>-------------------------------------------------------
>>>>This SF.net email is sponsored by: SF.net Giveback Program.
>>>>Does SourceForge.net help you be more productive? Does it
>>>>help you create better code? SHARE THE LOVE, and help us help
>>>>YOU! Click Here: http://sourceforge.net/donate/
>>>>_______________________________________________
>>>>glam-devel mailing list
>>>>gla...@li...
>>>>https://lists.sourceforge.net/lists/listinfo/glam-devel
>>>>
>>>>
>>>-------------------------------------------------------
>>>This SF.net email is sponsored by: SF.net Giveback Program.
>>>Does SourceForge.net help you be more productive? Does it
>>>help you create better code? SHARE THE LOVE, and help us help
>>>YOU! Click Here: http://sourceforge.net/donate/
>>>_______________________________________________
>>>glam-devel mailing list
>>>gla...@li...
>>>https://lists.sourceforge.net/lists/listinfo/glam-devel
>>>
>>>
>
>
>
>
|