Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Game Development

Reply
 
LinkBack Thread Tools Display Modes
Old 02-12-2010, 03:54 AM   #1 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 5
pipstapa is on a distinguished road
Default rotation and camera questions

I have recently started coding for the iPhone 3Gs, and I'm having a bit of trouble adjusting to the coding environment. Since you cant access any of the regular glFuncs, like glRotate, glTransform etc, do you need to do all this with the matrices? Say I want to rotate an object. Do i have to make a mvp-matrix that I do all functions on for the object and pass that to the vertexshader?

And also, what about the camera? How do you make a cameraobject that you can move around? glViewPort() seems very limited

I appreciate any help
pipstapa is offline   Reply With Quote
Old 02-16-2010, 05:00 PM   #2 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 1
maximus is on a distinguished road
Default

Hi pipstapa,

You should be able to use glRotate3f and glTranslate3f (notice the 3f). I have used them in my OpenGL ES game.

glViewport is not what you use for a camera object in the sense you're thinking of. glViewport just tells OpenGL what your screen is like, such as the width and height of it.

Camera transformations are done on the ModelView matrix, the same matrix you use for positioning/rotating models.

You want to use something like gluLookAt for your camera to get started. But OpenGL ES doesn't have it, so someone has written it for you here:
iPhone Development: gluLookAt()

Please look up the functions carefully in the OpenGL ES specification on Google, making sure you're passing the right arguments and whatnot.

Good luck!
maximus is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 398
7 members and 391 guests
13dario13, iOS.Lover, jeroenkeij, Leslie80, Wikiboo, Yosh_K
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,670
Threads: 94,121
Posts: 402,903
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Yosh_K
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 04:43 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0