Jump to content

  • Log In with Google      Sign In   
  • Create Account


BattleMetalChris

Member Since 06 Mar 2009
Offline Last Active May 16 2013 05:43 AM
-----

#4950110 Function "Overload" Question

Posted by BattleMetalChris on 17 June 2012 - 06:33 PM

Could you not just pass a reference to a vector of the parameters? This also lets you use templates if you plan on having several versions for different parameter types.

typedef std::vector<std::string> ParamsVec;



int foo(ParamsVec& params)

{

	 std::string str;

	 cin >> str;



	 int count = 0;

	 for (ParamsVec::iterator it = params.begin(); it != params.end(); ++it)

	 {

	 	 if ((*it) == str) return count;

	 	 count++;

	 }

}




EDIT: aargh, stupid source tags, why do they cut off angle brackets if I specify a language type?...


#4883761 c++ set operations

Posted by BattleMetalChris on 14 November 2011 - 08:11 AM

You could return an auto_ptr to the new set, that would take care of deleting it once you'd finished with it.


#4880676 Where i cant get xna skyboxes

Posted by BattleMetalChris on 04 November 2011 - 08:14 PM

The DirextX texture tool which comes with the DirectX SDK allows you to take any 6 images and put them together into a .DDS format cubemap texture for use as a skybox.

With a bit of manipulation in photoshop beforehand, it shouldn't be too hard to use it to convert skyboxes in other formats into the DDS Texture array you need. :)


#4879085 Encoding eight halfs into four floats

Posted by BattleMetalChris on 31 October 2011 - 07:12 PM

Got it working :)

I can paint lava onto the landscape and it'll use the heightmap and lava-map to make it run down into the hollows.




#4876796 Dummy Verticies

Posted by BattleMetalChris on 25 October 2011 - 10:13 AM

Yes, it's perfectly possible. I'm currently rendering quads by passing null as the vertex buffer and just using index buffers.


#4849168 Rotation problem on multiple monitors

Posted by BattleMetalChris on 14 August 2011 - 05:46 PM

If you're translating the camera as well as rotating it, remember that you'll need to change the eye position as each monitor's image is rendered.


#4848805 Rotation problem on multiple monitors

Posted by BattleMetalChris on 13 August 2011 - 05:43 PM

Its easier to calculate your view & projection matricies as per normal, but then edit the projection matrix with a scale & translate matrix to shift the results onto the appropriate screen.

Remember that the results of the final projection matrix yield a clip space coordinate from -1 : 1. You want -1 : 0 to end up on the left screen and 0 : 1 to end up on the right screen.




Trouble with that is it's all projected into the same viewing plane, just with a huge horizontal FOV which creates pretty atrocious warping at the edges of the display with multiple monitors (I run three monitors in compatible games, and my usual horizontal FOV is 160 degrees).

Ideally you want all the monitors to face the player and each display produced by a different view matrix, essentially using three cameras at different angles, instead of one stretched across all displays This creates a pleasing psudo-cylindrical projection, lets you run FOVs over 180 degrees and limits the warping to just the kind of extents you usually see on a single monitor with 90 degree FOV.

See the difference between these screenshots, both with 160 degree FOV (the discontinuities in the second shot are due to it compensating for the monitor bezels)

http://dl.dropbox.co...00003704384.png
http://dl.dropbox.co...00003988555.png

In response to the OP, is it not just a case of tweaking your offset value until they line up?


#4818065 iterators are they as fast as pointers?

Posted by BattleMetalChris on 31 May 2011 - 04:29 PM

'Frobnicate' is now my favourite word.


#4808678 David Braben's $25 PC

Posted by BattleMetalChris on 09 May 2011 - 01:30 PM

$25 and it has 1 more usb ports than the iPad :rolleyes:


#4806658 Baseball Field For your Game

Posted by BattleMetalChris on 04 May 2011 - 05:53 PM

Thank you?


#4800400 texcoord count is different than vertex count

Posted by BattleMetalChris on 19 April 2011 - 10:07 AM

What format are you exporting it to? obj?


#4792119 bump mapping vs normal mapping

Posted by BattleMetalChris on 30 March 2011 - 05:21 AM

Unless you're dynamically modifying the bump maps, is there any reason you'd need to use them over a precomputed normal map?


PARTNERS