It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I'm looking to create a simple voxel engine in C#. I know a lot of XNA but heard it would be better to do it in OpenGL / DirectX. Anybody know how I would accomplish such a thing? I do not want a library as I want to learn how to do it from scratch.
OpenGL and Direct3D are both "triangle" APIs - they aren't volumetric renderers. We need more information about what you want your voxel engine to do.
If you want to render voxels directly, then your best bet is to avoid OpenGL and Direct3D and write your own OpenCL or CUDA renderer (or even be 100% software on the CPU).
Rendering voxels to OpenGL or Direct3D would require converting the voxel world to triangles - using something like marching cubes. This technique can be efficient if the voxel world is fairly static and the voxels are large (like Minecraft). However this technique wouldn't work in massively-deformable worlds, for example, as you'd have to re-generate the triangle scene on a regular basis, which will be expensive.
Related
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I am quite amazed at what you can now do in an html5 canvas/svg driven by javascript, and I would like to know if there is any drawing library for .NET that would have similar performance and simplicity of use. I am thinking that if there were, then I could build some kind of tool that would be like d3.js for .net.
I am looking for a library that would allow me to draw svg-like elements in real time.
Any idea?
Using WPF and the canvas control you can do SVG like "drawing" very easy and like the HTML5 canvas is ofter hardware accelerated.
Other options would be using the DirectX api, either wrapped or native, XNA for pure game development or the GDI(+) library.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I would like C# code for determining the centre and radius of the circle that best fits the points in an array using the least squares method or equivalent.
Having searched on web I've found none.
You can either use a general minimization algorithm such as Levenberg-Marquardt or turn it into a linear problem and just solve for the parameters of the circle (x,y, radius). See this link for more information.
I'm not aware of any multivaraible Levenberg-Marquardt for .NET so the second solution is probably easier to go for. Note that you will need to solve a matrix equation of the form Ax=b to find your circle parameters. The Math.NET library seems able to do this.
You can try the FitEllipse function of the opencv library :
Fit ellipse
I think a C# wrapper of OpenCV exists.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I'm trying to create a car game in C#. I'm now trying to figure out a way to get some sounds into the game. For example, the acceleration sound of the car.
I recently tried to add a 5 second-sound of a real car accelerating, but I don't think its the right way to do it. Because then i have to start from the beginning all the time of the clip when i accelerate.
Is there maybe some way to work with frequencies? To send a frequency to the speakers and then just increase it when I accelerate (And to make it sound like a car)
I've heard about PWM, could that be something?
One way to approach this might be to mix some sounds together...
For example, if you had a series of sounds such as:
Car Idling
Car accelerating from 1st to 2nd, gear, etc
Sound of the car downshifting / engine braking
Sound of the car in each gear
You could just play different sounds at different times and cross-fade between them. Perhaps you could even do some pitch adjustment during playback to correspond to the throttle.
I'm not sure how the pros do it (Grand Theft Auto, Grand Turismo), but that's the first thing that comes to mind.
When I need audio in my C# projects I always try to use NAudio.
NAudio Algorithm to play a sinewave whose frequency can be changed smoothly in real time (there's a link to an algorithm the author wrote in the body of the question)
http://mark-dot-net.blogspot.com/2009/10/playback-of-sine-wave-in-naudio.html
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I was reviewing a code from a simple PONG game code in c#, the logic as far as I could understand was reading a key press (UP and Down) in a infinte loop and update the position of the ball and bar each n milliseconds one after another.
I want to know how to draw objects on a graphic box simultaneously?
I am just interested in making simple games using a imagebox and simple graohics.
If you want to make really simple games like Tetris or other puzzle-like, you could simply drop the "infinite loop" part. I've seen plenty of simple games built with Winforms/user controls/standard events (keypress/mousemove...).
If you plan to write something more complicated, then you probably want start learning XNA. Microsoft kindly provides useful starter kits.
You don't do it simultaneously, you do it in a loop but that loop happens so fast that a human cannot tell they are being updated one at a time.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I am well in C# with WPF. Now i want to develop game using WPF. But the problem is i have no basic idea about game development. Can any one give me any advice or any web side or any book reference for game development.
Check out the XNA Developer Centre.
I would use the XNA game development studio. It is designed for building games on the PC and the XBOX. I you are only building a simple 2D game I would scrap C# and work in BlitzBasic or PureBasic as they are very easy to build games.
It depends on what kind of games you want to write. If you want to write Puzzle games then WPF could work. Here is a nice tutorial that shows how to write a puzzle game in Silverlight: http://msdn.microsoft.com/en-us/WP7TrainingCourse_YourFirstWP7AppLab
If you want to write action games (Or pretty much any other kind of game) then XNA is the way to go like others have mentioned. It is a game framework after all.