按照轨迹运动如何实现

jsqinyinghao 2017-09-13 10:47:20
我准备做一个c++的项目。项目中,使用鼠标绘制一条运动线路,保存下来。然后用一个点,按照这个线路轨迹,从头移动到结尾处。请问有什么样的合适的方法?这个轨迹如何保存,如果轨迹可以交汇又怎么保存 移动的方法是什么
...全文
989 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
shiter 2017-09-29
  • 打赏
  • 举报
回复
轨迹保存主要使用点和时间,这样就是一个运动的数据结构了吧
真相重于对错 2017-09-14
  • 打赏
  • 举报
回复
前几天翻看高中数学,其中提到 3个函数的表示方法 1、公式法 2、图形法 3、数据列表法
幻夢之葉 2017-09-14
  • 打赏
  • 举报
回复
绘制线是MoveTo和LineTo等Win32函数
幻夢之葉 2017-09-14
  • 打赏
  • 举报
回复
WIN32开发 响应MouseMove, MouseDown,MouseUp等消息分别保存轨迹坐标和起始点 之后重绘,显示运动的点。速度控制那块可以计算全路径的长度/设定的时间,每时刻的点的位置也可以求出来
赵4老师 2017-09-13
  • 打赏
  • 举报
回复
MSDN98_1.ISO http://pan.baidu.com/s/1dDF41ix, MSDN98_2.ISO http://pan.baidu.com/s/1bnGo0Vl 先下载安装MSDN98 再参考: MSDN98\SAMPLES\VC98\MFC\TUTORIAL\SCRIBBLE\STEP1~7\*.* 和 LineDDA The LineDDA function determines which pixels should be highlighted for a line defined by the specified starting and ending points. BOOL LineDDA( int nXStart, // x-coordinate of line's starting point int nYStart, // y-coordinate of line's starting point int nXEnd, // x-coordinate of line's ending point int nYEnd, // y-coordinate of line's ending point LINEDDAPROC lpLineFunc, // pointer to callback function LPARAM lpData // pointer to application-defined data ); Parameters nXStart Specifies the x-coordinate of the line's starting point. nYStart Specifies the y-coordinate of the line's starting point. nXEnd Specifies the x-coordinate of the line's ending point. nYEnd Specifies the y-coordinate of the line's ending point. lpLineFunc Pointer to an application-defined callback function. For more information, see the LineDDAProc callback function. lpData Pointer to the application-defined data. Return Values If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. Windows NT: To get extended error information, callGetLastError. Remarks The LineDDA function passes the coordinates for each point along the line, except for the line's ending point, to the application-defined callback function. In addition to passing the coordinates of a point, this function passes any existing application-defined data. The coordinates passed to the callback function match pixels on a video display only if the default transformations and mapping modes are used. QuickInfo Windows NT: Requires version 3.1 or later. Windows: Requires Windows 95 or later. Windows CE: Unsupported. Header: Declared in wingdi.h. Import Library: Use gdi32.lib. See Also Lines and Curves Overview, Line and Curve Functions, LineDDAProc
cain-won 2017-09-13
  • 打赏
  • 举报
回复
mark一下,你这个问题难度不小

5,530

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 模式及实现
社区管理员
  • 模式及实现社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧