Question

I'm new to CUDA and experimenting with the samples of the NVidia GPU SDK.

The goal is to rotate the spheres in the Particles example. So while the sphere is falling, it's also rotating, any pointers please?

Was it helpful?

Solution

In the particles sample the particles are just points with a radius. They have no angular momentum in the simulation, because they are assumed to be point masses, not sphere masses (i.e. all of their mass is assumed to be exactly at their centers.)

If you want to do this physically, you would have to use a simplified rigid body dynamics rather than just point masses.

If you just want to visually rotate the particles (non-physically), you can do that by just applying a rotation matrix to the GL matrix stack before you draw the object that you display for each particle (you mentioned a torus). This could be done in OpenGL, independently of the CUDA simulation code.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top