小编NIK*_*HIL的帖子

自iOS6以来,GLKTexture未正确映射

在我的3D对象上使用纹理时,我在Xcode 4.5和iOS 6 SDK中遇到了一个奇怪的行为.在针对OS X 10.8 SDK构建时,我的mac应用程序中也会出现此问题.

我在iOS上使用OpenGL ES 2.0,在OS X 10.8上使用OpenGL传统配置文件(<3.0).

纹理不再放置在正确的坐标处,我有很多工件.VAO正确上传,看起来很好,没有纹理.使用XCode 4.4.1和iOS 5.1 SDK时一切都很好.

VAO完全相同(使用OpenGL ES帧捕获检查),并且纹理制服绑定正确.


Xcode 4.4 VAO概述

Xcode 4.4

Xcode 4.5 VAO概述

Xcode 4.5

XCode 4.4.1(iOS 5.1 SDK)

iOS模拟器5.1 SDK

XCode 4.5(iOS 6 SDK)

iOS模拟器6.0 SDK


代码/着色器片段

用于上传和处理纹理的相关部分.我不得不将着色器剥离到minium.

顶点着色器

precision highp float;
attribute vec2 a_vTextureCoordinate;
uniform mat4 u_mModelViewMatrix;
uniform mat4 u_mModelViewMatrixInverse;
uniform mat4 u_mProjectionMatrix;
uniform mat4 u_mNormalMatrix;
void main()
{
....

    // Transform output position 
    gl_Position = u_mProjectionMatrix * u_mModelViewMatrix * a_vPosition;
    // Pass through texture coordinate v_texcoord = a_vTextureCoordinate.xy;
    v_vPosition = vec3(u_mModelViewMatrix * …
Run Code Online (Sandbox Code Playgroud)

shader opengl-es ios opengl-es-2.0 glkit

19
推荐指数
1
解决办法
679
查看次数

我想在Iphone中将NSData转换为double值

我想要NSData的隐蔽内容实际上我需要作为双重类型我怎么能转换它?

这里1ff46c56 7dd86f40 nsdata字节,我想要双倍

iphone types objective-c ios

15
推荐指数
2
解决办法
3113
查看次数

手势方法(Pan Gesture和Swipe Gesture)之间是否有任何优先条件?

我正在开发一个应用程序,我使用了Pan Gesture以及Swipe Gesture.因此,每次我执行Swipe Gesture时,Pan手势中的方法总是被调用,并且Swipe Gesture方法不会被调用.

所有的手势方法之间有没有优先权?

iphone uigesturerecognizer ios uiswipegesturerecognizer uipangesturerecognizer

11
推荐指数
2
解决办法
1万
查看次数

10
推荐指数
1
解决办法
3240
查看次数

如何将图像转换为base64字符串

我想将图像转换为base 64 encode to string.从那里发送到oma_status-iconxml格式的服务器.

但我从服务器响应中得到不受支持的编码....

有没有其他方法将图像转换为base64字符串?

plz..help ...

我的代码是:

        Bitmap bitmapOrg = BitmapFactory.decodeResource(getResources(),  R.drawable.image);

        ByteArrayOutputStream bao = new ByteArrayOutputStream();
        bitmapOrg.compress(Bitmap.CompressFormat.JPEG, 100, bao);
        byte [] ba = bao.toByteArray();

         String ba1=Base64.encodeBytes(ba);
Run Code Online (Sandbox Code Playgroud)

xml base64 encoding android encode

8
推荐指数
1
解决办法
2万
查看次数

选择时Cocos2d CCMenuItem动画

我有一个CCMenu5 CCMenuItem秒.当用户触摸菜单项时,我希望菜单项移动到右边10个像素,以区别于其他像素.我尝试将每个菜单项设为全局变量,所以我可以说:if (item.isSelected) { [item runAction:blah]; }但这没有做任何事情.到目前为止这是我的代码:

CCLabelTTF *sin = [CCLabelTTF labelWithString:@"Single Player" dimensions:labelSize alignment:UITextAlignmentLeft fontName:font fontSize:20];
item1 = [CCMenuItemLabel itemWithLabel:sin target:self selector:@selector(goToSinglePlayer:)];

CCLabelTTF *spl = [CCLabelTTF labelWithString:@"Splitscreen" dimensions:labelSize alignment:UITextAlignmentLeft fontName:font fontSize:20];
item2 = [CCMenuItemLabel itemWithLabel:spl target:self selector:@selector(goToSplitscreen:)];

CCLabelTTF *ach = [CCLabelTTF labelWithString:@"Achievements" dimensions:labelSize alignment:UITextAlignmentLeft fontName:font fontSize:20];
item3 = [CCMenuItemLabel itemWithLabel:ach target:self selector:@selector(goToAchievements:)];

CCLabelTTF *str = [CCLabelTTF labelWithString:@"Store" dimensions:labelSize alignment:UITextAlignmentLeft fontName:font fontSize:20];
item4 = [CCMenuItemLabel itemWithLabel:str target:self selector:@selector(goToStore:)];

CCLabelTTF *set = [CCLabelTTF labelWithString:@"Settings" dimensions:labelSize alignment:UITextAlignmentLeft …
Run Code Online (Sandbox Code Playgroud)

iphone animation cocos2d-iphone ios ccmenuitem

6
推荐指数
2
解决办法
3174
查看次数

我想以每秒像素的速度跟踪fingure运动的速度是否可能任何等待?

我想跟踪Touch的移动速度像素/秒
任何Budy有这个想法

PanGesture方法除外

iphone touch uitouch iphone-sdk-3.0

4
推荐指数
1
解决办法
2502
查看次数

如何以编程方式确定iPhone上的默认铃声?

有没有办法从我的应用程序中确定哪个铃声已被设置为用户iPhone上的默认铃声?

如果是这样,怎么办呢?

/Users/nikhil.dhamsania/Library/Application Support/iPhone模拟器/用户/媒体/ iTunes_Control/iTunes/ringtones.plist

这是在模拟器中存在ringtones.plist文件的路径,我们可以做一些事情,比如获取iPhone中活动铃声的状态吗?

iphone cocoa-touch objective-c ringtone ios

4
推荐指数
1
解决办法
1797
查看次数

我想在某个特定阶段删除Box2D中的连续碰撞检测我怎么能过来?

==>我正在开发像carom board这样的游戏由于持续的碰撞检测,我面临的问题很少.

  1. 如图所示,由于碰撞检测前锋和灰色冰球一起徘徊,游戏无法在此之后继续播放并在那里不断播放声音

  2. 我只想第一次在撞击者或冰球击中对方或框架(墙壁)时播放声音,但在我的情况下,如果我把撞击者放在靠近墙壁的声音是连续播放

屏幕截图 非常感谢您提前帮助非常感谢

iphone cocos2d-iphone iphone-sdk-3.0 box2d-iphone

2
推荐指数
1
解决办法
496
查看次数