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

Mockup & CodeGen, iPhone & iPad
($9.99)

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

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 02-02-2010, 08:36 PM   #1 (permalink)
CasualDays
Registered Member
 
Join Date: Mar 2009
Posts: 47
Default Zoom on 3D Objects

Hi!
I've been following these tutorials, and I was wondering if it was possible to modify this tutorial to allow for zooming:

iPhone Development: OpenGL ES From the Ground Up, Part 3: Viewports in Perspective

I just want to zoom in and out using a slider.

I'm thinking by modifying this piece of code:
Code:
CGRect rect = view.bounds; 
GLfloat size = .01 * tanf(DEGREES_TO_RADIANS(45.0) / 2.0); 

glFrustumf(-size,                                           // Left
            size,                                           // Right
           -size / (rect.size.width / rect.size.height),    // Bottom
            size / (rect.size.width / rect.size.height),    // Top
            .01,                                          // Near
            1000.0);                                          // Far
I should be able to achieve what I want. But I need some guidance!

Thanks for your time!
CasualDays is offline   Reply With Quote
 

» Advertisements
» Online Users: 296
22 members and 274 guests
ADY, apatsufas, BdR, Diegan, djohnson, Duncan C, F_Bryant, glenn_sayers, Guthook, Herbie, ilmman, Joseph Nardone, Music Man, NSeven, Profile, rodgo, TheWebWizz, VikMyr, vogueestylee, yomo710, zbynda, ziocleto
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,876
Threads: 89,225
Posts: 380,708
Top Poster: BrianSlick (7,129)
Welcome to our newest member, jorge599
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 08:01 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.