FB图形例题3D旋转【VFB源码】
2018-03-08 22:58
316 查看
这是 FB 自己内部绘图专用函数画的动画当然可以用翻译为 GDI画,这里只是演示代码运行方式感兴趣的可以下载源码研究。基本代码: ScreenRes 800, 600, 32
Dim As Long fps
ReDim As V3 Va()
Dim As String d = "ABCD"
Randomize 13
AddABox(va(), Type < V3 > (400, 300, 0), 350, 2, 2, RGB(250, 100, 0)) 'skewer
'flip 90 degrees on y axis
memcpy(@va(LBound(va)), RotateArray(va(), Type < _float > (0, 1.570796, 0), vct(400, 300, 0), 0), (UBound(va) - LBound(va) + 1) *SizeOf(v3))
'Add text
For n As Long = 0 To Len(d) -1
Var zv = map(0, (Len(d) -1), n, -250, 250)
AddAChar(Va(), Chr(d
), 150, RGB(Rnd * 255, Rnd * 255, Rnd * 255), "Arial", FS_BOLD, zv)
Next n
'knob at the end
addasphere(va(), Type < V3 > (400, 300, -350), 30, RGB(200, 200, 0), 1)
Dim As Single ang, rad
Dim As v3 Ptr rr
Color, RGB(100, 100, 100)
Do
ang += .025
If ang > 1.570796 * 4 Then ang = 0 '2*pi
rr = RotateArray(va(), Type < _float > (.5, ang, 0), vct(400, 300, 0), 1)
quicksort(rr, 0, UBound(va) -1)
ScreenLock
Cls
Draw String(10, 10), "FPS =" & fps
Draw String(10, 30), "Elements = " & UBound(va)
For n As Long = LBound(va) -1 To UBound(va) -1
rad = map( -500, 500, rr
.z, 5, 2)
Circle(rr
.x, rr
.y), rad, rr
.col, , , , f
Next n
ScreenUnlock
Sleep Regulate(30, fps), 1
Loop Until Len(Inkey)源码下载:Basic语言编程群 78458582 进QQ群后,在群共享里下载。
相关文章推荐
- 【附源码】【Android 3D OpenGL】开发之二——旋转的三角形【MacroCheng原创】
- css3 3d图形旋转显示
- Ios精品源码,tableview下载视频直播源播放器图片位置3D立体旋转相册屏风动画
- Ios精品源码,tableview下载视频直播源播放器图片位置3D立体旋转相册屏风动画
- ADO例题【VFB源码】
- 3D语音天气球(源码分享)——创建可旋转的3D球
- OpenGL_Qt学习笔记之_04(3D图形的绘制和旋转)
- 3D语音天气球(源码分享)——创建可旋转的3D球
- OpenGL3D图形、旋转、纹理、键盘移动、光照、滤波、透明(完整)
- OpenGL3D图形、旋转、纹理、键盘移动、光照、滤波、透明(完整) 复制代码
- VML之带背景的3D图形任意旋转
- ISpVoice语音(VFB源码)微软TTS语音引擎调用例题
- 3D语音天气球(源码分享)——创建可旋转的3D球
- 3D语音天气球(源码分享)——创建可旋转的3D球
- Android 3D图形的手势旋转(未完成,求大神指点)
- 论坛源码推荐(10.15):3D旋转特性的弹出窗口,漂亮的多功能提醒视图
- 实现3D旋转(源码)
- 3D语音天气球(源码分享)——创建可旋转的3D球
- 【附源码】【Android 3D OpenGL】开发之二——旋转的三角形【MacroCheng原创】
- OpenGL3D图形、旋转、纹理、键盘移动、光照、滤波、透明(完整)