Re: Object Graphics: multiple Views of same model [message #28558 is a reply to message #28553] |
Tue, 18 December 2001 08:59   |
Dick Jackson
Messages: 347 Registered: August 1998
|
Senior Member |
|
|
"David Fanning" <david@dfanning.com> wrote in message
news:MPG.168901ed44c97ffe9897b0@news.frii.com...
> Martin Downing (martin.downing@ntlworld.com) writes:
>
>> Ok, todays object graphics question:
>> Say you have a 3D object model and you want to view it in 2 or 3
orthogonal
>> directions as you rotate/manipulate it.
>> Can this be done with a single object instance?
>
> If I wanted to see two or more views of the same
> polygon object, I think I would start by create
> two or more polygon objects that all shared the
> same data (with the SHARE_DATA keyword). Each
> object could go into its own model, each model
> into its own view, and the views could be
> collected into a scene, that I would display
> in my window.
>
> This scheme allows you to manipulate the models
> independently to get two or more views of the
> same polygon dataset.
SHARE_DATA is handy, but as a helpful colleague just reminded me, I think
what you may be looking for is to use IDLgrModel::Add, /Alias as follows...
Add graphic objects in as usual for the first view
View 0:
Model 0:
obj0
obj1
...
Then, add the *same* objects to the second model using Add, /Alias
View 1:
Model 1:
*obj0*alias*
*obj1*alias*
...
The advantage over SHARE_DATA is that all the object attributes are
maintained (color, shading settings, etc.), not just the data
(vertices/connectivity). Of course, for the times when you want it,
SHARE_DATA is just the ticket.
It might be handy if we could put all our objects in one model and add it to
the two views (one real, one as alias), but this is not possible.
Watch out when destroying objects, you can safely destroy the Model 1 (with
aliases), which *won't* destroy the contained objects, then destroy Model 0,
which *will*.
Hope this helps.
Cheers,
--
-Dick
Dick Jackson / dick@d-jackson.com
D-Jackson Software Consulting / http://www.d-jackson.com
Calgary, Alberta, Canada / +1-403-242-7398 / Fax: 241-7392
|
|
|