Re: Updating DCS nodes via node callbacks

New Message Reply Date view Thread view Subject view Author view

Angus Dorbie (dorbie++at++multipass.engr.sgi.com)
Thu, 21 Aug 1997 18:54:16 -0700


On Aug 21, 4:56pm, Julia Ellery wrote:
> Subject: Updating DCS nodes via node callbacks
> Hello
>
> I am trying to modify code that moves an object with the eyepoint
> eg. a headup display object. The object is created with a DCS node
> that is updated to match the eyepoint position immediately after
> the eyepoint is updated between pfSync and pfFrame. This works fine.
>
> Now, for the sake of generalisation, I want such objects to
> be modelled in the database as normal and flagged as being
> "stuck to eyepoint" so that the Realtime code can put a
> node callback on the DCS node, in a similar way to other
> special effects. However, I cannot seem to get this to work
> whatever callback I try and put the code in
> (ie. pre/post_app/cull/draw). The object "shudders" and seems
> to change scale, as well as not correctly moving with the eyepoint.
>
> Is it possible to do this sort of thing on a callback and
> if so, how?
>
> I have other DCS nodes that I am currently updating altogether
> after pfFrame, that I am considering moving "locally" to
> their respective node callbacks but now wonder if this
> will give similar trouble.

This is a *really* bad idea, it will exhibit the same difficulty,
the culling information will also be bogus since the cull process won't know
about object positions in the draw.

You need to perform the update in the application to stick an object
to the eye. Otherwise you have to pass the information downstream
using pfcyclebuffer methods and the culling will *very* likely be wrong.

The reason you see shuddering is the timing of your application driven
object position *write* in memory is asynchronous with the update of
the DCS in the draw callback which *reads* the same memory for the
position info.
The update will also happen too early if you don't buffer
the information downstream.

If you just update everything in the application the DCS and channel
position matrix info will be sent downstream at the same time when you
call pfFrame and you don't have to worry about cycle buffers or anything
else.

Cheers,Angus.

=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
            Submissions: info-performer++at++sgi.com
        Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:55:46 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.