Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 20 Jun 2011
Offline Last Active Private

#5196154 Is there algorithm for boxcasting or thickray casting?

Posted by on 03 December 2014 - 05:30 PM

I think you have a collision detection problem, not a ray-casting problem.

Why can't you put a single object in multiple grid cells?  Each cell would contain a list of objects.

I think this would make more sense if you have a very large object that overlaps several grids.

#5182283 position camera for object to fit in screen height

Posted by on 22 September 2014 - 07:09 PM

cameraDistance = ( modelHeight / 2 ) / tan( fovy / 2 )


If you want to fit any model completely, then you should fit the model's bounding sphere within the camera, not just the model's height or width.

#4881618 Apples new patent (what a joke)

Posted by on 07 November 2011 - 09:11 PM

<br /><a href='http://www.tomsguide.com/us/Slide-to-Unlock-Apple-Patent-Android-unlock-Patent-infringement,news-12998.html' class='bbc_url' title='External link' rel='nofollow external'>http://www.tomsguide...news-12998.html</a><br /><br />Im suprised graphics techniques have not been patented yet. I mean after this, then what other hope do we have. The progress of man kind is going to hell.<br />

<br /><br /><br />

Wow, just one more reason why the rich are getting richer and the poor are getting poorer in this country.
I'm sure one can blame a bloated patent system with killing the economy at some point.
The rich and powerful have nothing better to do except stifle and hinder advancements in technology

Someone file a patent, and lets it sit and collect dust in some file cabinet for 20 years. They have no intention of
improving their so-called invention. It's just leverage to make the strong stronger, and the weak weaker.

Whatever happened to the day when people filed patents, they did it so they could have the time needed to market a real invention?

#4831153 mipmap dx11

Posted by on 04 July 2011 - 03:34 PM

<br />If you read the documentation for ID3D11Device::CreateTexture2D carefully, you'll notice that it says this for pInitialData:<br /><br />&quot;Pointer to an array of subresource descriptions; one for  each subresource&quot;<br /><br />So if you create a texture with N mip levels, you must pass an array of N D3D11_SUBRESOURCE_DATA's each containing the data for a mip level. The same goes for texture arrays. Note that you're not &quot;creating the memory&quot; for those mip levels, you're just passing in the data to initialize the mip levels with. <br /><br />Calculating the number of mip levels is really easy:<br />

<br />
UINT GetNumMipLevels(UINT width, UINT height)<br />
{<br />
&nbsp;&nbsp;&nbsp; UINT numLevels = 1;<br />
&nbsp;&nbsp;&nbsp; while(width &gt; 1 &amp;&amp; height &gt; 1)<br />
&nbsp;&nbsp;&nbsp; {<br />
    &nbsp;&nbsp;&nbsp; width = max(width / 2, 1);<br />
    &nbsp;&nbsp;&nbsp; height = max(height / 2, 1);<br />
    &nbsp;&nbsp;&nbsp; ++numLevels;<br />
&nbsp;&nbsp;&nbsp; }<br />
<br />
&nbsp;&nbsp;&nbsp; return numLevels;<br />
}<br />
<br />

<br /><br /><br />

I think DX creates mipmap levels down to 1x1. It doesn't stop until both dimensions are 1x1.

int GetNumMipLevels(int width, int height)
	int numLevels = 1;
	while((width > 1) || (height > 1))
    	width = max(width / 2, 1);
    	height = max(height / 2, 1);

	return numLevels;