|
From: Gregory H. <gha...@ya...> - 2002-02-21 09:17:52
|
Hi - this message provides more information on the specific task that
I'm having trouble accomplishing with OpenVRML. Any additional help
would be appreciated!
=20
Thanks for all this help, <helpful list subscriber's name removed>. I am
not working with just one part described in a single VRML file - these
parts are uploaded to me as VRML files and I need to create the six
images from those files. I don't have control over the authoring of the
VRML, unfortunately. They are created by a CAD tool in most cases and
do not contain any viewpoint information.=20
=20
I do, however, have the ability to modify my class that's derived from
ViewerOpenGL (or even ViewerOpenGL if I have to). Here's the
pseudo-code of what I want to do:
=20
1. Receive Uploaded File
=20
2. Compute Bounding Box of the "part" described in the file
=20
3. Compute six points that give me views of the object that
result in a nice edge-to-edge "fit to window" for the "part" given a
particular window size
=20
4. Create renderings from each of these six points, into an
OpenGL rendering context that writes to a DIB (bitmap)
=20
5. Compress the six bitmaps into JPG's
=20
6. Return the six JPG's to the user
=20
I can do all of this with ease except numbers 2 and 3, which require me
to understand a little bit more about the OpenVRML library/toolkit. Do
you think it's possible to solve this problem using the OpenVRML kit?
Thanks again for your help - it really is appreciated.
=20
// greg //
=20
-----Original Message-----
From: <helpful list subscriber>
Sent: Tuesday, February 19, 2002 6:55 PM
To: Gregory Hassett
Subject: Re: [openvrml-develop] Boudning boxes, setting viewpoints &
perspectives
=20
Hello,
The easiest way is to use a VRML authoring tool to incorporate the
viewpoints into your VRML file. Then take screenshots of the resulting
image in WinLookat/MacLookat/Lookat or in a commercial browser.
However, you seem to want to actually modify the ViewerOpenGL. I only
have the Mac source but there is a HandleKey method I believe in
ViewerOpenGL. This is what would process the next and previous viewpoint
commands dynamically. You still need the viewpoints in the VRML file so
you still need an authoring tool. HandleKey will probably just tell you
what key is mapped by the OpenVRML libraries to viewpoint navigation
since there does not seem to be a user manual. You can subclass
ViewerOpenGL and modify HandleKey to get special shortcut navigation
results.
Configuring the ViewerOpenGL methods for particular hardcoded situations
would require re-coding every time your viewing requirements change (say
from corner of part).
<helpful list subscriber>
=20
[Original message to which the helpful list subscriber
replied:]
=20
Hi,
My goal is to use openvrml to generate six rendered images (one view
from the center of each of the six =1Csides of the bounding box) of a =
part
that I am going to manufacture.
The part is described in a VRML file.
To do this I need to calculate the bounding box, and then configure the
ViewerOpenGL to have the proper viewpoints. If I have two objects, a
VrmlScene which Ive loaded and a ViewerOpenGL-derived class that Im
rendering with, whats the =1Cright way to accomplish this?
Your help is much appreciated!
-- Gregory Hassett, Paris, France
|