OpenFrameworks 教程0

习惯写代码的人总是从0开始

简单介绍一下:

OpenFrameWorks 是 用C++开发,用来做交互式互动软件的。其基础就是封装了的openGL,除了openGL图形库,还包含了XML、POCO、SOCKET等一系列工具,能够让人在此框架上快速开发出高性能的互动程序。它具有很好的跨平台性,能够写一遍代码在Windows、Mac,PC平台上通用也能够在Android、IOS等移动设备上编译后运行。

其官方网址:点击打开链接

网站包含了代码、文档、以及社区,最近又看到有翻译为中文的版本,不过还不太完善,只翻译了主页,不过相信日后肯定会做得更好。

下面进入主题,这次主要讲一下在Window上面的配置包括Vs以及Android

一、Windows下Android配置

工具:

1.eclipse eclipse下载

下载之后直接解压到你喜欢的文件夹我的是:C:\Android,之后进入文件夹打开eclipse的执行程序

之后选择你的工作目录,这个先随便选择一个好了。

在工具条里面找到Help->EclipseMarketplase,打开之后就可以看到eclipse的各种插件,我们需要的是Android和C++NDK的环境,所以在搜索框里输入相应的关键词android,

找到下图对应的就可以了,不过建议最好翻墙进行下载,这样速度会快很多、很多,同理,C++插件也是这样进行的

插件安装好之后,下面是SDK的安装一个是android的SDK百度云盘下载,下载好之后,在eclipse工具栏中Window->preference选择你的SDK的路径

C++在eclipse上面编译运行,绝对少不了的是NDK,具体NDK是什么,大家去百度。

根据现在这个版本的Openframeworks,我们需要NDK的版本是android-ndk-r10e,网上百度一下有很多的可以下载,我这里就不在赘述

需要说明的是,下载好NDK解压之后,需要在环境变量中新建NDK_ROOT变量值为你的NDK的路径。C:\Android\android-ndk-r10e是我当前NDK的路径

这个设置好之后,在找到eclipse如果你还没关闭的话。同样的找到Window->preference中的Android下面的NDK子选项,将我们的NDK路径选择进去

如果上面都没问题的话,说明你已经配置好了Android和C++开发安卓的环境了,但是要开发Openframeworks你还需要下载一个工具

Mingw点我找到下载  这个工具是帮助进行C++变异的,具体的就要问度娘了~~

下载好之后,运行安装,选择目录,下面是打开界面,里面有很多可选项,具体看你的需求,不过吧Basic Setup勾选,然后倒入就够用了,下载时间有点漫长

当然,要在环境变量中的path中加入C:\MinGW,以便于控制台进行查找

到此为止,我们的环境算是搭建好了

打开OpenFrameworks官网找到Download下载,选择eclipse+adt进行程序包的下载

下载后解压我的解压路径是D:\AndroidWorkspace\of_v0.9.3_android_release,现在需要我们把eclipse的工作目录切换到D:\AndroidWorkspace\of_v0.9.3_android_release\examples\android

有个方便的办法,在不关闭eclipse的情况下,再次打开eclipse 他会提示工作目录被占用,需要另选工作目录,那么你就可以借此选择我们需要的工作目录,再把之前打开的eclipse关闭就可以了。

下面我们Import程序

Import in this order:

  • openFrameworks/libs/openFrameworks
  • openFrameworks/addons/ofxAndroid/ofAndroidLib
  • openFrameworks/examples/android/androidEmptyExample
不过我发现,第一个总是引入不进来,但是不影响程序,索性不管咯。

在你import进来之后,android会进行编译,注意标记的地方。如果顺利的话,应该就可以了,你就可以直接run在android程序上了,编译过程比较缓慢,我也很没办法~~有大牛的话,请指教



看一下 空项目运行效果,手贱第二张代码中修改了一下背景颜色,咯咯咯


明天再说winddows中VS配置。。毕竟刚卸载了Vs2013要装Vs2015

期待和大家的交流

安静安静安静安静安静安静安静安静安静安静安静安静安静安静安静安静安静安静安静安静安静安静安静安静安静安静安静安静安静安静安静安静安静安静安静安静安静安静

接昨天的继续。VS上面的就很简单了,装了一晚上的VS2015,然后直接去OF官网上下载对应的开发包就可以了,Windows上面有大概300M解压后有1G

然后随便进入example文件夹打开,编译运行,上图

配置就到此为止了,至于linux系统以及max系统配置,就不做了。。。。


Create stunning, interactive openFrameworks-based applications with this fast-paced guide About This Book Generate 2D and 3D graphics with openFrameworks Create a video synthesizer project and run it on multi-platform devices Use networking and Arduino to control your application Who This Book Is For If you are a programmer, visual artist, or designer with experience in creative coding, and want to use openFrameworks to create fun, stunning, and interactive applications, this is the book for you. Basic knowledge of programming languages, such as C++, Java, Python, or JavaScript, will be enough to proceed with the book. What You Will Learn Install openFrameworks and create a new project Generate 2D and 3D graphics Mix images and videos and process them with shaders Add GUI controls and adjust them from external devices and apps using the OSC protocol Control parameters with a timer, Perlin noise, and sound and text files Use the Arduino to control your application Build a video synthesizer project Run your project on iOS, Android, and Raspberry Pi devices In Detail openFrameworks is a cross-platform programming toolkit and library to perform creative coding in C++. It contains all you need to efficiently implement real-time tasks, such as generating 2D and 3D graphics, processing video and sound, and using networking. openFrameworks Essentials is a guide that can be used for learning and using openFrameworks to develop creative and artistic real-time applications. It is a fast-paced tutorial that begins with installing openFrameworks, and then takes a step-by-step approach towards using openFrameworks to build a video synthesizer project. We will investigate and implement features such as 2D and 3D graphics, GUI, shaders, reaction on sound, the OSC networking protocol, and the Arduino. This book will empower you with the practical skills required to build creative apps and projects using openFrameworks. Table of Contents Chapter 1: Getting Started with openFrameworks Chapter 2: Creating Your First openFrameworks Project Chapter 3: Adding GUI and Handling Keyboard Events Chapter 4: Working with Raster Graphics – Images, Videos, and Shaders Chapter 5: Creating 3D Graphics Chapter 6: Animating Parameters Chapter 7: Distributed and Physical Computing with Networking and Arduino Chapter 8: Deploying the Project on iOS, Android, and Raspberry Pi Chapter 9: Further Resources Appendix A: Video Synthesizer Reference Appendix B: openFrameworks Quick Reference
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值