Home
Reply
Contributor
Posts: 20
0

How to get the top view from changing camera?

Hi

I use Set_Camera_Target,Set_Camera_Position,Set_Camera_Up_Vector to change a camera. Now, I want to set the top view of the current view, but the origin point does not change, anyone has suggestions?
I try to change the camera,but the origin point is changed too. I want to know why? And how to set the camera?


Thanks in advance.

Tina

111.JPG
Spatial Employee
Posts: 19
0

Re: How to get the top view from changing camera?

Those are the correct HOOPS commands to use.  However, I don't see a "refresh" command.
With a "refresh" command, you can set a seriesr of viewing parameters and not be continually updating the view, until you call "refresh".


Spatial provides source code for the Scheme toolkit application.  You may want to check out:


    SPAScmExtHoops\ha_scm.m\src\view_ha.cpp
        void  HoopsView::refresh(logical update_sils)
        void HoopsView::flush()
        int UpdateAllViews()
    SPAScmExtHoops\ProtectedInterfaces\view_ha.hxx
        void HoopsView::set_eye(const SPAposition& p)


Looking at this code, you will see calls to HC_Set_Camera_Position, HC_Control_Update_By_Key(), HC_Update_Display(), HC_Update_One_Display, and HC_Flush_Contents.


I hope the Scheme example code helps.

Spatial Employee
Posts: 19
0

Re: How to get the top view from changing camera?

I meant to include HC_Set_Camera_Target in that list also.  Be sure to use modeling coordinates, and not screen coordinates (pixels). 

Contributor
Posts: 20
0

Re: How to get the top view from changing camera?

Thank you very much.

 

By the way, how to get the modeling coordinates?


I use HC_Show_Net_Camera_Target,HC_Show_Net_Camera_Position,HC_Show_Net_Camera_Up_Vector to get the point,this point is modeling coordinates or screen coordinates?

 

I'll appreciate your help.

 

Tina

Spatial Employee
Posts: 19
0

Re: How to get the top view from changing camera?

These are 3D modeling coordinates.

To convert between the 2D screen coordinates and 3D modeleing coordinates, use Compute_Coordinates(...). 

For examples, see HOOPS documentation on the 2D Tutorial: Soccer. 

Or look thru SPAScmExtHoops\ha_scm.m\src\view_ha.cpp, especially HoopsView::drawable_to_world(...).

Contributor
Posts: 20
0

Re: How to get the top view from changing camera?

Thank you very much.

 

 

Tina