Jump to content

  • Log In with Google      Sign In   
  • Create Account

rubenhak

Member Since 21 Jun 2007
Offline Last Active Jun 18 2012 11:45 PM

Topics I've Started

How to Scale Animation Object

15 June 2012 - 04:25 PM

Hi Everybody,

I've got an animated character imported to my engine which I want to scale. First I scaled the mesh vertex positions and the mesh itself looks perfect. The trouble is to scale my bones and animation transformation matrices. How should I multiply my transformation matrix so that animations of my bones would not get completely disassembled.

Thank you,
Ruben

Need a tip to load biped animation

21 May 2012 - 11:53 AM

Hi,

I want to load a character animation from a 3ds max. I'm capable to export transformation based animations (when objects are translated/rotated) into my engine. However in this case there is a mesh of the character which is put on top of the animated skeleton.

With my current techniques of exporting/importing I get the skeleton animated in my engine, but the actual character is not.

What is the technique to make my character to animate instead? Do I need to do some calculations in my engine, or there is more information to grab from 3ds max to make that happen?

Thank you,
Ruben

OpenAL interruption issue on iOS device

17 May 2012 - 04:24 PM

Hi Everybody,

I'm experiencing a nasty problem on iOS device related to audio playback. Tried to get some help from apple developer forum but does not seem like it is anyhow developer friendly. Hope I can get some help here.

The problem is that if during application load user presses "Home" button and minimizes the application the OpenAL does not get initialized properly and no sound comes out off my application anymore. It has to get totally killed and relaunched to get the audio working.

The error I'm getting right after activating OpenAL context is:
<0x3edabd98> AURemoteIO::Initialize failed: -12985 (enable 2, outf< 2 ch,  44100 Hz, Int8.24, non-inter> inf< 2 ch,	  0 Hz, Float32, non-inter>)
<0x3edabd98> AURemoteIO::Initialize failed: -12985 (enable 2, outf< 2 ch,  44100 Hz, Int8.24, non-inter> inf< 2 ch,	  0 Hz, Float32, non-inter>)

Further I tried to hook up to audio interruption event in order to properly handle audio interrupts, but this does not seem to work. The interrupt handler is not getting called. I initialize the audio session like this:
AudioSessionInitialize(NULL, NULL, OpenALInterruptionListener, this);


and then try to handle the interruption like that:

void OpenALInterruptionListener(void * inClientData, UInt32 inInterruptionState)
{
    OpenALDevice * device = (OpenALDevice *) inClientData;
   
    if (inInterruptionState == kAudioSessionBeginInterruption)
    {
		  alcSuspendContext(_context);
		  alcMakeContextCurrent(_context);
		  AudioSessionSetActive(false);
    }
    else if (inInterruptionState == kAudioSessionEndInterruption)
    {
		  UInt32 sessionCategory = kAudioSessionCategory_AmbientSound;
		  AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(sessionCategory), &sessionCategory);
		  AudioSessionSetActive(true);   
		  alcMakeContextCurrent(_context);
		  alcProcessContext(_context);
    }
}

but anyway my "OpenALInterruptionListener" function is not getting called.

Any help is appreciated!

Thank you,
Ruben

Screen coordinate unprojection to 3D coordinate(ray)

16 May 2012 - 12:39 AM

Hi,

I know this has been discussed but want to confirm that I'm doing it the right way. I want to get the coordinate under the mouse pointer for the z=0 plane. This is my code:
mat4 projectionMatrix = GetPerspectiveMatrix();
mat4 projectionMatrixInverse = glm::inverse(projectionMatrix);
mat4 viewMatrix = GetViewMatrix();
mat4 viewMatrixInverse = glm::inverse(viewMatrix);


vec2 screenCoord = MathLib::vec2(x, y);
vec2 normalizedCoord2D = MathLib::vec2(2.0 * screenCoord.x / viewportSize.x - 1.0, 2.0 * screenCoord.y / viewportSize.y - 1.0);
vec4 worldCoordNear;
vec4 worldCoordFar;
  {
   vec4 normalizedCoordNear = vec4(normalizedCoord2D.x, normalizedCoord2D.y, -1.0, -1.0);
   vec4 clipCoordNear = normalizedCoordNear;
   vec4 eyeCoordNear = projectionMatrixInverse * clipCoordNear;
   worldCoordNear = viewMatrixInverse * eyeCoordNear;
  }
  {
   vec4 normalizedCoordFar = vec4(normalizedCoord2D.x, normalizedCoord2D.y, -1.0, 1.0);
   vec4 clipCoordFar = normalizedCoordFar;
   vec4 eyeCoordFar = projectionMatrixInverse * clipCoordFar;
   worldCoordFar = viewMatrixInverse * eyeCoordFar;
  }

So now if i build a ray with worldCoordFar & workdCoordNear points and intersect it with a the z=0 plane, would I get the correct coordinate?
I'm just bit worried about /w division which I'm not sure where to put when unprojecting from 2d to 3d.

Thanks,
Ruben

My First iPhone Game Released!

09 May 2012 - 03:36 PM

Hi Guys,

I've just got my first iPhone game approved and released in the Apple App Store. I'd appreciate if you could give it a try, rate it and like it!

The app is called "Scorpion3D" by "Rudi Games". Once downloaded you'd see the scorpion on a screen and move around. You would be able to tap his sting and claws which would make him angry and he would fight you back Posted Image. To reset the screen just shake your device. You can also change the way he looks and the accessories he can be equipped with using buttons on the top left and right corners.

Icon: Posted Image
Name: Scorpion 3D
Developer: Rudi Games
iTunes Link: App Store - Scorpion 3D
Facebook Fan Page: https://www.facebook.com/Rudi.Inc

Thank you!
Ruben

Screenshots:
Posted Image Posted Image Posted Image Posted Image

PARTNERS