# kiniport

Member

25

130 Neutral

• Rank
Member

2. ## ArtificialSort

Release mode. Yeah, I was surprised too.

5. ## Culling a 16x16 area in a quad tree fashion

I think you want something like this: void cull(int xoff,int zoff,int size) { int view=isBoxInFrustum(x,0.0f,zoff,size,height,size); if(view==1 && size>1) { size/=2; cull(xoff,zoff,size); cull(xoff+size,zoff,size); cull(xoff,zoff+size,size); cull(xoff+size,zoff+size,size); } else { int x,z; for(z=zoff;z<zoff+size;z++) for(x=xoff;x<xoff+size;x++) sectorBuf[z][x]=view; } } Then just do cull(0,0,16); to start.
6. ## Normal of a non-convex poly

Thank you Wasting Time, Newell's method is exactly what I needed(and pretty close to what I had guessed). ;)
7. ## Normal of a non-convex poly

Since its a non-convex polygon, if I take the cross product of a pair of edges that are on a "concave" part of the polygon, the normal will be in the wrong direction. jpetrie: My polygons are planar. Proper triangulation of a non-convex polygon is pretty involved, and definately seems like overkill.
8. ## Normal of a non-convex poly

I'm tryinbg to simply and reliably trying to find the normal on a non-convex polygon. Currently, I'm summing the cross product of all neighboring edges, which works for most cases, but not all. Any ideas?
9. ## Gravis Xperience,, hows it do that?

Try keybd_event() Edit: Nevermind, I guess that dosen't work anymore.
10. ## Program still running after PostMessageQuit(0) [SORTED]

I'm not sure, but I think you need to pass NULL for the window handle on GetMessage. Otherwise I think it filters out the WM_QUIT, because I don't think it's associated with the apps window. while (GetMessage(&msg, NULL, 0 , 0))
11. ## Number of Edges In Connected Cubes

This is what I get: (h+1)*w*(d+1) + (w+1)*h*(d+1) + (h+1)*(w+1)*d Simplified(sort of). 3*h*w*d + 2*w*d + 2*h*w + 2*h*d + h + w + d I'm not sure if it's right, but it works for your example.(w=h=2,d=1)
12. ## Whats Wrong with this?

Maybe stdin and cin don't work together?
13. ## c++ memory issue

You could just do this: Foo Foo::doSomething() { Foo result; // Do stuff to result. return result; }
14. ## Slowing a ball in a variable framerate

You could calculate the speed at a fixed time step(like 60hz) and interpolate. mult=ln(.9)/60 while(dt > 1/60th of a sec) { speed=speed*mult } speed_est=speed-speed*(1-mult)*dt*60 [Edited by - kiniport on December 16, 2005 2:53:44 AM]
15. ## Experiment with a (real) ant.

Quote: Given a finite number of queens, and an infinite probability for a mutation to be detrimental, what pops into your logic that's the logical result? I agree most mutations would probably kill the colony. Just like most mutations in a dog would kill the dog. But there are many more ant colonies than there are dogs, and I'm sure the life of a queen is alot shorter. So I imagine ant colonies could evolve alot faster than a large animal like a dog.