Raydium 3D Game Engine

Official forum for everything about Raydium, ManiaDrive, MeMak, ...
It is currently Wed Jun 28, 2017 7:12 pm

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Sat Jul 12, 2008 9:20 am 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
Here a new function to orbit around a point:
Code:
void raydium_camera_orbitmove(float x, float y, float z, float x_to, float y_to, float z_to)
{
    static float delta_x,delta_y;
    raydium_mouse_move(raydium_window_tx/2, raydium_window_ty/2);
    delta_x+= raydium_mouse_x - (raydium_window_tx/2);
    delta_y+= raydium_mouse_y - (raydium_window_ty/2);
    raydium_camera_internal_prepare();
    glRotatef(raydium_camera_look_at_roll,0,0,1);
    raydium_camera_look_at_roll=0;
    gluLookAt(x,y,z,z_to,x_to,-y_to,0.,0.,1.);
    glRotatef(delta_y,0,1,0);
    glRotatef(delta_x,0,0,1);
    raydium_camera_internal(x,y,z);
}

Should i commit this?

Why I have put an initial position instead a distance? Cause it's more compatible and easy-to-mix with the other camera functions.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group