开发者

3D Programming in Objective-C "Only"

[I'm going to be interviewed for a position, and I don't want to oversell myself...]

I can do just about anything in Objective-C (some things need a lot of code) in 2D, but I haven't actually learned any C fundamentals (except as related to Obj-C). For instance, if an Array is not an NSArray I don't know how to work with it. That said, I feel comfortable doing 2D animations in Objective-C using UIView animations or using Core Animation directly.

Without knowing C, is it possible to work in 3D (or even do 3D ga开发者_高级运维mes) on the iPhone? I think I'm asking about OpenGL ES, but that might not be the only option...?


Learning 3D graphics programming is an entirely separate issue from learning basic C. Yes, learning basic C will help you to become a better Objective-C developer, but it will not help you learn 3D programming. What is more important is that you have a good understanding of topics like 3D geometry and linear algebra.

This thread provides a great breakdown of the challenges of moving from 2D to 3D. It is geared towards making games, but many of the points covered are relevant to 3D programming in general.


In addition to what Justin Ardini said, I must say that 3D programming on an iPhone passes through OpenGl ES or a Graphic Engine like Irrlicht or SIO2.

Now, not knowing anything about C will make it almost impossible to accomplish: consider that OpenGL relies on C and Irrlicht and SIO2 on C++ (and C++ is derived to C even if it is not a strict superset of it like Objective-C is) as far as I know. Add to this that an array is the basic data structure (along with a struct) that C/C++ and Objective-C use.

Let me add two point on why to learn C.

  • Learning a language with supports the imperative programming paradigm is in some way useful in understanding one that supports OO. And the lowest code you can write, assembly, supports only it.
  • Objective-C as said before is a superset of C so everything written in C is legal in your obj-C code. You can understand it better and try to use it in some impressive ways (by calling the correspondent C functions sometimes for instance), and you may be able to make your code really efficient for some heavy duty tasks (and you'll find a lot in 3d programming)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜