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
•
Reply
•
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
•
Reply
•
Refresh
•
New Topic
•
Search
•
Previous
•
Next
1
掌柜推荐
¥980.00
SME-PD3H双路冗余输入可编程速度继电器转速监控超速保护厂家直销
¥287.00
双福N1H-1C-70 100齿轮转速传感器测速探头免磁铁全螺纹M12*1脉冲
¥296.00
N1H-9A-55转速传感器齿轮探头霍尔非接触M14*2推挽3线有源脉冲
¥294.00
N1H-5A-70转速传感器非接触式测齿轮M18*1.5免磁铁带插头厂家直销
¥1,480.00
DRE-AE2H-AC双向转速速度继电器超速欠速正反转保护控制20mA输出
¥487.00
D1H-7A-55 100双向测速齿轮传感器M18*1速度转速正反转识别5A*1.5
©
Sun 2024-9-8
Guidance Laboratory Inc.
Email:
webmaster1
g.yi
.
org
Hits:
0