Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

NumberXaero

Member Since 29 Apr 2002
Offline Last Active Today, 12:16 AM
*****

#5057126 OpenGL glTranslatef problems

Posted by NumberXaero on 26 April 2013 - 08:07 PM

Read up on orthographic projections, the whole point is that things wont change in size, the far and near plane values are probably culling the triangle after you move back.




#5009657 Point lights won't work!

Posted by NumberXaero on 11 December 2012 - 08:34 PM

I dont see the directional light being given a direction vector, and I dont see anywhere where youve given the point light a position. Did you set either?


#5004418 Want to get started on using XML

Posted by NumberXaero on 26 November 2012 - 10:59 PM

Theres not a lot to learn about xml, but a good starting place would be the tinyxml lib/docs
http://www.grinninglizard.com/tinyxml/


#4998267 C++ Opengl, unresolved externals after linking libraries

Posted by NumberXaero on 06 November 2012 - 05:57 PM

void EnableOpenGL(HWND hwnd,HDC * hdc,HGLRC * hrc); <-- BIG L


end of file

void EnableOpenGl(HWND hwnd,HDC * hdc,HGLRC * hrc) <-- little l


#4997917 How do I keep the screen from squishing and stretching?

Posted by NumberXaero on 06 November 2012 - 01:59 AM

Are you updating your projection matrix?


#4989220 Having trouble deleting vectors

Posted by NumberXaero on 11 October 2012 - 01:46 PM

Where is "bulletIterator" defined? I dont see it, I see "bulletIT", is bulletIterator a typo? or another variable that shouldnt be there?
I would call the line "(*bossIT).hit();" before doing any list clean up just so that the logic of your if statement collision check is done before things start getting deleted and moved around. erase removes the current element and returns an iterator to the next, which is end() if you erase the last element.
   for (std::vector<bullet>::iterator bulletIT = aBullet.begin(); bulletIT != aBullet.end(); ) // Loops around each bullet
   {
	if((*bossIT).xPosition() + 32 >= (*bulletIT).xPosition() && (*bossIT).xPosition() <= (*bulletIT).xPosition() + 10 && // Detects Collision
		 (*bossIT).yPosition() + 32 >= (*bulletIT).yPosition() && (*bossIT).yPosition() <= (*bulletIT).yPosition() + 10)
	{
		 (*bossIT).hit();
	 bulletIT = aBullet.erase(bulletIT);   // update iterator with next if collision
	}
	else
	   ++ bulletIT;   // no collision go to next bullet
   }



#4961841 Up axis problem with 3d Models [OpenGL]

Posted by NumberXaero on 21 July 2012 - 09:04 PM

In my 3D studio max exporter I have a flag that makes Y up because Max's up is +Z. What the flag does is applies a +90 rotation about the +X axis (right handed) to the object (or models skeleton root) transform, this rotates Max's +Y (my Max forward convention) to align with opengl +Y up, and swings the Max -Z (down) up to become the opengl forward (-Z is forward in opengl for me). If the objects transform is translated away from the origin you may have to swap its z and y, and then negate the new z.

There are many places where you can solve it. Flag it on export if you can. Flag it on the model when loading. Manually rotate the object before exporting. I wouldnt mess with opengl, Id rather tweak the data. I do it this way because it doesnt have an impact on animations, its just an additional transform at the root so that objects are not on their side (or face down on floor). Overall its just a pain.

I think maya is Y up by default but can be changed, Max doesnt allow it to be changed, in case you do import into Maya, initially you might have the same problem as with opengl.


#4961190 Does information on PhysX exist?

Posted by NumberXaero on 19 July 2012 - 11:47 PM

The \Samples and \Documentation folders are pretty good places to start, what are looking for?


#4961094 Scaling a model, should I multiply the joint matrices as well?

Posted by NumberXaero on 19 July 2012 - 05:06 PM

You should be able to just apply a scale to the root joints local transform and have it propagate down through all the child joints world transform calculations. Then just use each joints world transform with the bind pose matrices as usual.


#4959824 PhysX Detaching Shapes hard to understand

Posted by NumberXaero on 16 July 2012 - 07:09 PM

I guess you are referring to the snowman example, where you can hit the snowmans nose with a snowball and the nose falls to the ground.
In that example they build the snowman, and set the nose shapes filter data with a custom detachable flag. In the contact report callback, when nose shape is hit by a snowball (also has a custom flag) the nose shape is saved in a list for detaching. At some other point at the end of the frame, the list of detachables is processed, each nose shape (created initially as part of the compound dynamic snowman?) is recreated as dynamic actor by itself.
The nose material, render model and transform are copied to the new dynamic actor. The dynamic nose is then dropped into the scene with a small force applied while the static nose is deleted.
So the original compound nose shape is detached from the snowman, and copied to a dynamic actor and allowed to move freely in the scene.

What physx version are you using?


#4930716 Getting frustum planes from orthogonal projection

Posted by NumberXaero on 12 April 2012 - 03:59 PM

If you have camera information of some sort that this frustum belongs to, you could use the forward, up, and right vectors to get 3 of the normals, negate them to get the other 3.
Then use these 6 normals with the view position and the l, r, t, b, n, f values to compute positions on the planes.


#4921214 Weird effect when FBO size doesn't match window size

Posted by NumberXaero on 11 March 2012 - 05:40 PM

Whats the viewport set to?


#4908257 Quaternion.... angles?

Posted by NumberXaero on 31 January 2012 - 08:05 PM

Try a Quaternion from axis angle. You have the angle, you know you want to rotate about the x axis.

angleRad *= 0.5
q.w = cos(angleRad);
q.v = nrmAxis * sin(angleRad)

then combine this quaternion with the existing one, and use the result.


#4852123 How to convert a Camera if I only have an axis angle

Posted by NumberXaero on 21 August 2011 - 10:40 PM

The info you need seems to be there

              	// transform matrix
        *TM_ROW0 0.6726   0.7400	-0.0000
        *TM_ROW1 -0.4469  0.4062	0.7971
    	*TM_ROW2 0.5898   -0.5361   0.6039
    	*TM_ROW3 546.8461 -133.5005 375.1562 	// translation

        *TM_POS 546.8461	-133.5005   375.1562   // translation pulled from matrix

        *TM_ROTAXIS -0.7092 -0.3138 -0.6314   // resulting axis from convert matrix to axis/angle
        *TM_ROTANGLE 1.2224       			// angle part of axis/angle conversion (in radians it seems)

    	*TM_SCALE 1.0000	1.0000  1.0000   	// no scale (probably because its a camera)

you could take this info and convert it to angles if you want, look up matrix to yaw pitch roll.


#4847953 C++ showing vectors problem

Posted by NumberXaero on 11 August 2011 - 03:59 PM

Need to see more code to know exactly why, but the place you are running that loop, does not have "inventory" in its scope, so it cant "see it" and therefore cant print its contents.




PARTNERS