Re: Help for a beginner!!

New Message Reply Date view Thread view Subject view Author view

Jan Barglowski (jan++at++euryale.chinalake.navy.mil)
Mon, 7 Apr 1997 09:46:49 -0700 (PDT)


Keerthan wrote:
> 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?

A few things to consider:
- That is assuming that the model you are using is "centered" at 0,0,0.
  If the model's is lying a few units along an axis in it's local
  coordinate system, it will appear a few units along that same axis
  (unless you rotate it) in the Performer coordinate system. In other
  words, the model's local origin is loaded to the Performer origin.

- Your assumption on the view position/orientation is correct.

- I've modified simple.C a *lot*, and one of the things I had to do
  was modify the Near/Far clipping planes. Extend your Far clip
  to 1000 or so, and you may just see the object!

> Also ,could someone explain what the following segment does, especially
> how the new position is computed?
[...code removed...]

The code rotates the view position on the XY plane in a circle of radius
2*bsphere.radius. The view angle (heading) is adjusted to look
towards the origin at the same time. The net effect is the model
loaded in by simple.c looks like it's rotating, but really the
viewpoint is travelling around the model!

> I dont know if performer has got any coordinate system like openGL(where
> you set using glOrtho)

The Performer coordinate system is shown on page 96 of the Performer
Programming Guide.

jan

-- 
Jan Anthony Barglowski	              jan++at++chinalake.navy.mil
Real-time Computer Graphics           http://www1.ridgecrest.ca.us/~jan
Naval Air Warfare Center, China Lake  (619) 927-1057
=======================================================================
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.