zhiva: (Default)
[personal profile] zhivaTuesday, December 27th, 2011 12:56 pm
From CC3Camera.h:

Therefore, for cameras, the scale and uniformScale properties are not applied to the transform matrix. Instead, the uniformScale property acts as a zoom factor (as if the camera lens is zoomed in or out), and influences the fieldOfView property accordingly.
[..]
Once a nominal field of view has been set in this property, changing the scale or uniformScale properties will change the effective field of view accordingly (although the value of the fieldOfView property remains the same). Scales greater than one zoom in (objects appear larger), and scales between one and zero zoom out (objects appear smaller).


I made a cocos3d project (it comes with test layer: rotating, color-changing "Hello World"), slightly modified world code:

-(void) initializeWorld {

// Create the camera, place it back a bit, and add it to the world
CC3Camera* cam = [CC3Camera nodeWithName: @"Camera"];
cam.location = cc3v( 0.0, 0.0, 6.0 );
[self addChild: cam];
cam.uniformScale = 0.12; // <== added this line

and tried to run it with different values for cam.uniformScale.

Results: http://imgur.com/a/Pe9N9
Zooming out works as advertised only on (0.25; 1] interval. On (0; 0.25] it's all kinds of wrong.

December 2025

S M T W T F S
 123456
78910111213
14151617 181920
21222324252627
28293031   
Page generated Saturday, January 24th, 2026 02:10 am
Powered by Dreamwidth Studios