Re: Help for a beginner!!

New Message Reply Date view Thread view Subject view Author view

Andy Shein (ashein++at++orac.boston.sgi.com)
Mon, 7 Apr 1997 10:15:09 -0400


Hello Keethan

On Apr 6, 6:00pm, Keerthan wrote:
> Subject: Help for a beginner!!
> Please excuse me if this question is too trivial!! I think that the
> origin in a Performer window is at the center and the view point lies
> there. If this is correct, then the object in the simple.C
> (pguide/libpf/C++)program should lie at the center once loaded.In order
> to view the object, I use
>
> pfCoord view;
> view.xyz.set(0.0f,0.0f,15.0f);
> view.hpr.set(0.0f,-90.0f,0.0f);
> chan->setView(view.hpr,view.xyz);
>
> I am setting my camera 15 units along z-axis and rotating the pitch 90
> degrees in clockwise direction so that the camera will look downwards.Is
> my assumption right?If so why am I not able to see the object?Has it got
> anything to do with the bsphere.radius stuff.If so why?

   It also depends on what your viewing volume is set to.
What are the Channel near/far values. What you have looks correct
are you sure the model loaded ? Try doing a
pfPrint on the scene.

   The base performer coordinates are y into the screen, x to the right
and z up. This is different from OpenGL

>
> Also ,could someone explain what the following segment does, especially
> how the new position is computed?
>
> while (t < 20.0f)
> {
> pfCoord view;
> float s, c;
>
> // Go to sleep until next frame time.
> pfSync();
>
> // Initiate cull/draw for this frame.
> pfFrame();
> t=pfGetTime();

   The makes the eyepoint rotate about the origin
The SinCos computes the eye position (orbit) and
>
> // Compute new view position.
> pfSinCos(45.0f*t, &s, &c);
> view.xyz.set(2.0f*bsphere.radius*s,
> -2.0f* bsphere.radius*c ,
> 0.5f *bsphere.radius);
> view.hpr.set(45.0f*t, -10.0f, 0.0f);
                       ^^^^^^^
This makes the eyepoint look at the center. It rotates
at the same speed as the position so it
is always looking at the origin. Kinda' like the moon
always faces the earth.

> chan->setView(view.xyz, view.hpr);
>
>
>
> pfFrame();
> // }
>
>
> I dont know if performer has got any coordinate system like openGL(where
> you set using glOrtho)

   You can always draw stuff in OpenGL in your
node callbacks or the channel draw callback.
Take a look at text.C in the /usr/share/Performer examples
section.

>
>
> Thanks,
> Kiran
> =======================================================================
> List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
>-- End of excerpt from Keerthan

-- 
Andrew Shein   SE Stout               email: ashein++at++boston.sgi.com
Silicon Graphics Inc.                 phone: (508) 562 - 4800
1 Cabot Road                            fax: (508) 562 - 4755
Hudson, MA 01749                      vmail: 59688
=======================================================================
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:01 PDT

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