|
From: S.K.Bose <bo...@pa...> - 2001-09-07 05:18:32
|
On 6 Sep 2001, [ISO-8859-1] St=E9phane Genaud wrote:
> One is : i can hardly set the image loaded by openvrml in a
> frame with given height and width. I know the window
> size of the client and i would like to draw the vrml
> scene in the given limits, resizing if necessary so
> that the full scene fits the client display.
> The following code does not shrink (resize) the scene but
> truncates the scene if it is too wide.
>=20
> viewer is an ViewerOpenGL object.
>=20
> extern "C"
> bool vrml_load_scene(char *szName,int width,int height)
> {
> if(!viewer)
> return ( false );
> if (viewer->scene()->load(szName)) {
> fprintf(stderr,"debug : resize to %d %d\n\n\n",width,height);
> viewer->resize(width,height);
> return (true );
> }
> else {
> fprintf(stderr, "[server] error in VRML file parsing ...");
> return( false );
> }
> }
viewer->resize() will set "Viewport" only. You have to redraw the scene
after this by viewer->redraw().
Thanks,
Bose
|