Guidance
指路人
g.yi.org
Guidance Forums
/
wxWidgets (wxWindows) in C++
/ Using mouse to rotate...
最新
搜索
论坛
Reginald Rexx
STC(宏晶)单片机与电路设计
wxWidgets (wxWindows) in C++
奇瑞QQ车友论坛
生活信息交流与学习角
质量与可靠性
Rapid-Q Basic
FreeBasic
Reginald
Forum
Examples
RapidQ
Forum
Bugs
Examples
Resource
RQ Doc
RQ Intro
System
LeonAutoBackup
Home
Software
App
Lib
RapidQ
Reginald
Upload
Chrononet
回顶部
⇑
Forum List
•
Thread List
•
Refresh
•
New Topic
•
Search
•
Previous
•
Next
1
1.
Using mouse to rotate...
#7846
Posted by:
2006-02-07 03:14:19
Hi guys,
I?ve implemented a camera Class in my app and want to rotate the camera Left-Rigth and Up-Down using mouse. So I need the mouse inicial position and the final one in the event, but I?m not sure how to do that :(
Could anyone shed some light ?
I?ve tried to do this:
void Canvas::OnMouseMove( wxMouseEvent &event )
{
wxPoint ptInicial, ptFinal;
event.GetPosition( &ptInicial.x, &ptInicial.y );
if ( event.Moving() )
{
event.GetPosition( &ptFinal.x, &ptFinal.y );
camera->rotateLeftRight( (GLfloat)ptInicial.x - (GLfloat)ptFinal.x );
camera->rotateUpDown( (GLfloat)ptInicial.y - (GLfloat)ptFinal.y );
}
Refresh();
}
Where my OnMouseMove() is a EVT_MOTION message.
The camera doesnt change the rotation at all like that.
What?s wrong?
Thanks in advance!
2.
Re: Using mouse to rotate...
#7869
Posted by:
2006-02-11 09:07:11
Just to tell that i?ve found it. It?s the WarpPointer() method defined in wxWindow class.
:D
Forum List
•
Thread List
•
Refresh
•
New Topic
•
Search
•
Previous
•
Next
1
掌柜推荐
¥470.00
FGM-R80-BI背光指针式油量表转速表20mA接口可定制双福厂家直销
¥470.00
TMM-R80-BH背光指针式转速表船用柴油机发电机用500rpm厂家直销
¥1,580.00
DMM-R100-BV双向转速表背光指针式正反转船用尾轴转速表孔径102
¥1,370.00
SRE-PD2H CRS99速度继电器转速监控监视仪采集超速保护报警RS485
¥410.00
VMM-R52-B直流电压表DC7~25V指针式带背光可定制电压范围
¥840.00
双福SRE-AD0H-AC转速脉冲频率电流电压模拟量变送器模块20mA显示
©
Fri 2025-1-17
Guidance Laboratory Inc.
Email:
webmaster1
g.yi
.
org
Hits:
0