User Name
Password
AppleNova Forums » Programmer's Nook »

A place to start (Graphical Cocoa)


Register Members List Calendar Search FAQ Posting Guidelines
A place to start (Graphical Cocoa)
Thread Tools
ast3r3x
25 chars of wasted space.
 
Join Date: May 2004
Send a message via AIM to ast3r3x  
2008-12-18, 14:18

I have a project I want to work on that requires hundreds (hopefully thousands) of shapes drawn to the screen, all moving and knowing when they collide. However I am very new to Cocoa and not really sure about the best way to go about this. In fact I am not sure HOW to go about this since I've never done Quartz/CImage/CAnimation anything before and was hoping people could give me a push in the right direction.

Before I even embark on this first…is this something that I'm going to be able to do? I mean can a normal computer handle thousands of 2d shapes being drawn and all moving around with some sort of collision detection?

If it can, where do I even start?

Edit: All this stuff is going to be 2D.
  quote
Enki
Senior Member
 
Join Date: Nov 2004
 
2008-12-18, 14:37

That kind of code can use a few Cocoa API's but it will mostly be straight C or C++. There are people who do that kind of thing as career projects or degree research into how to make it work well and quickly.

If you are not already a crack coder with a desire to spend a couple years on getting it right, go straight to http://www.box2d.org/ and use it as the engine. Do the windowing environment in Cocoa. Marriage made in heaven.
  quote
RobUSVI
Member
 
Join Date: May 2007
 
2008-12-19, 07:07

A few places to help you find information:

http://www.cocoadev.com/
http://developer.apple.com/

As pointed out above, a game/physics engine might be the easiest way to go.
  quote
Brad
Selfish Heathen
 
Join Date: May 2004
Location: Zone of Pain
 
2008-12-19, 08:26

Quote:
Originally Posted by Enki View Post
If you are not already a crack coder with a desire to spend a couple years on getting it right, go straight to http://www.box2d.org/ and use it as the engine.
I've not used either, but another more robust option to consider may be Open Dynamics Engine, the physics/collision engine that 2D Boy chose to use for World of Goo.

The quality of this board depends on the quality of the posts. The only way to guarantee thoughtful, informative discussion is to write thoughtful, informative posts. AppleNova is not a real-time chat forum. You have time to compose messages and edit them before and after posting.
  quote
Enki
Senior Member
 
Join Date: Nov 2004
 
2008-12-19, 13:23

ODE is old, creaky and uses a set of algorithms that require hacks to keep things stable. Bullet is a FAR better open source 3D physics engine. Box2D is done with many of the same techniques as Bullet, but in the 2D versions.
  quote
ast3r3x
25 chars of wasted space.
 
Join Date: May 2004
Send a message via AIM to ast3r3x  
2008-12-20, 16:04

Thanks guys, this is definitely going to be a lot more work than I originally planned, but it'll probably be a great learning experience.

I decided to go with box2d because I'm not sure I could wrap my head around 3d stuff right now although I think that would be something cool to add in the future. I have box2d working, although right now I need to figure out the best way to animate things in cocoa.
  quote
Enki
Senior Member
 
Join Date: Nov 2004
 
2008-12-20, 18:58

Don't try to "animate it in Cocoa". Animate it in you code using Box2D and just display the result in a Cocoa-based display. http://developer.apple.com/samplecod...aGL/index.html
  quote
Posting Rules Navigation
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Post Reply

Forum Jump
Thread Tools
Similar Threads
Thread Thread Starter Forum Replies Last Post
iCal graphical representation event plugin... thingy. katori Third-Party Products 0 2006-08-25 13:19
Can iChat lose the graphical smilies? alcimedes Apple Products 14 2006-08-10 11:52
graphical personality test ghoti AppleOutsider 55 2006-05-17 13:20
Learning Cocoa? pmazer Programmer's Nook 10 2005-11-23 20:56
Cocoa Programming adam_tj Genius Bar 1 2005-01-14 16:49


« Previous Thread | Next Thread »

All times are GMT -5. The time now is 20:03.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004 - 2024, AppleNova