游戏开发论坛

 找回密码
 立即注册
搜索
查看: 2135|回复: 1

[菜鸟请教]如何在3d环境中实现用鼠标控制视角的变换

[复制链接]

1

主题

2

帖子

0

积分

新手上路

Rank: 1

积分
0
发表于 2006-4-24 03:00:00 | 显示全部楼层 |阅读模式
从3dsmax中load到vc环境中一个3d的虚拟城市
如何用鼠标控制不同的视角
比如可以上下平移整个城市的模型,可以旋转,可以放大缩小(放大缩小用鼠标的中间的滚轮)

,谢谢朋友回答

8

主题

41

帖子

41

积分

注册会员

Rank: 2

积分
41
发表于 2006-4-24 10:02:00 | 显示全部楼层

Re:[菜鸟请教]如何在3d环境中实现用鼠标控制视角的变换

void glTranslated(
  GLdouble x,  
  GLdouble y,  
  GLdouble z   
);

void glTranslatef(
  GLfloat x,
  GLfloat y,
  GLfloat z  
);

Parameters
x, y, z
The x, y, and z coordinates of a translation vector.


void glRotated(
  GLdouble angle,   
  GLdouble x,      
  GLdouble y,      
  GLdouble z        
);

void glRotatef(
  GLfloat angle,   
  GLfloat x,      
  GLfloat y,      
  GLfloat z        
);

Parameters
angle
The angle of rotation, in degrees.
x, y, z
The x, y, and z coordinates of a vector, respectively.




或者用这个功能的类。可以自己写,也可以参考别人的。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2026-1-24 07:04

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表