# bnf

Member

17

138 Neutral

• Rank
Member
1. ## Finding a set of even spaced points on a circle?

Ok, working now, stupid error was preventing it. The issue now is that the circle starts at the origin and sweeps around towards positive X axis, but sweeps Y in both positive and negative. Meaning, the center of the circle is not the origin, which is what I want.
2. ## Finding a set of even spaced points on a circle?

Quote:Original post by Tom Sounds like rounding errors. If you're using ints, try using floats instead. Yeah I'm using floats and still having the problem. One thing worth noting is that sin(angle * i), cos(angle * i)) does not create a value large enough for the size of the spheres i'm trying to render, so I multiplied it by 10. That shouldn't be an issue though.
3. ## Finding a set of even spaced points on a circle?

Quote:Original post by SiCrane In terms of computer programming, take 2 Pi, divide by the number of points, and use sin and cos on multiples of that angle to create the points. e.g.: angle = 2 PI / 7 point = [] for i in range(0, 6) point.append( Point(sin(angle * i), cos(angle * i)) ) Yeah this is what I have and its creating a circle, but when I place objects at those points by translating them there, they are not perfectly spaced. Some are showing up closer than others.
4. ## Finding a set of even spaced points on a circle?

What's the quickest way to arrange a set of points or objects in a circle, evenly spaced?
5. ## What's a good way to calculate a subdivided square?

I meant rectangles because yeah you'd need to change the sides of them to even get close to having no gaps, but it sounds like its not possible or if it is it would be a problem that could take a very long time to solve with large sets of rectangles.
6. ## What's a good way to calculate a subdivided square?

The title for this post was hard to word. Here's what I'm trying to do. I have a collection of rectangles, their sum of their area equals 100% and should fit inside a parent square. How can I figure out the position and dimensions of all these squares so that they fit inside the master square, perfectly filling it up with no gaps, so that there is adjecency between all squares? The percentages that these squares represent will change over time so I need to keep updating their size in length and width along with the neighboring square. Am I making sense?
7. ## Dreaded template errors are killing me!

Quote:Original post by Cygon Uhm, template support MSVC .NET 2003 (aka 7.1) is more standards conformant than Intel C++ 8.1. And what you're doing is pretty basic stuff, don't see why it should even require templates. Did you leave it out or is there no general "pushclass" template ? Because you can't specialize a class for which no generic template is available (even an empty one would suffice). -Markus- I left out the pushclass template. And secondly, this is from a library that I did not write. I am not aware that 7.1 is more standard compliant when it comes to templates. I had heard differently from Intel, but maybe they are blowing smoke in my face.
8. ## future of .NET

Quote:Original post by MENTAL Quote:Original post by MikeyO I find half life 2 locks up for a second or two quite a bit while it loads resources like sounds, if they haven't fixed it by now, it's usually right after a loading screen or going into a new room. What does loading a resource from the hard drive have to do with automatic garbage collection which happens in RAM? Quote:Original post by MikeyO Saying you shouldn't make a half life 2 in C# is like saying you shouldn't win the olympic gold medal in ski jumping: most people couldn't win the gold medal if they tried. Most people here are not going to be able to make a half-life 2 anyway, maybe use all the CPU and GPU power half-life 2 does, but they would probably be used wastefully and inefficiently. Is it just me or does that not make much sense? #1: Agreed. I fail to see the connection between disk access times for HL2 and GC in .NET. #2: It's not you.
9. ## future of .NET

Quote: Even with that, there were still minor hiccups during LOD transitions, GUI transitions, etc. The biggest pauses were during song transitions, and that's just because you can't work around DVD seek times. No, not "even with that", the point is it took them a lot of time and sweaty paranoid evenings to make sure that the biggest problems were during song transitions. The dev I spoke to bemoaned the GC in Lua for that reason. So if its a problem in a controlled evironment, then I'm failing to see how it gets easier to deal with on a PC? But again, you are clinging to the GC issue, and avoiding the points made about address space management and custom allocation. Look, if your app doesn't need it, then that's fine. And moreover, I think the common sense approach here is that if you are not shipping a high calibur title then .NET is fine for now. It will probably get beter. But its definitely a matter of opinion as to whether its "infinitely better" than tracking down memory leaks. I know that I don't have to work very hard anymore to avoid memory leaks in C++ with all of the tools and techniques. Its easy to start doing things in .NET where allocations are happening behind your back and this rule is harder to enforce. Judging by the reactions to this thread, there is a mixed opinion on this. So go and use what works for you.
10. ## future of .NET

Quote:Original post by Trap Only a full collect can stop the app longer than 0.1 s. If your app does full collects it's your fault. In non-gc apps you have to manage freeing memory, in gc-apps you have to manage allocating memory. No full collects will be necessary if you don't allocate memory after loading your data. The GC is more forgiving though, it only stops you app for some time, a missing free/delete will kill your app over time. Whats wrong with IDisposable and using? Like I said, its not just GC, its the ability to control allocation, address space. .NET would have done well to have included an option for reference counting, unobtrusively, unlike AddRef.. in COM.