Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 180 181 [182] 183 184 ... 796

Author Topic: if self.isCoder(): post() #Programming Thread  (Read 887925 times)

Mego

  • Bay Watcher
  • [PREFSTRING:MADNESS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #2715 on: July 27, 2012, 07:11:49 am »

Which is considered a valuable bit though? 0? 1?

You troll.

Derekristow

  • Bay Watcher
    • View Profile
    • Steam ID
Re: if self.isCoder(): post() #Programming Thread
« Reply #2716 on: July 27, 2012, 08:49:47 am »

Which is considered a valuable bit though? 0? 1?

The 1s of course.  What would you need the 0s for, there's nothing in them.


Would any of you happen to have a grasp of quaternions?  They're giving me some funky issues, and I don't think I understand them well enough to figure it out.

Edit: Oh, for anyone who hasn't heard of them, quaternions are super awesome for 3D rotation.  This article and the XNA Quaternion class were all I needed to get started using them, and they've proven pretty easy to use once the actual math gets abstracted away a bit.
« Last Edit: July 27, 2012, 08:54:18 am by Derekristow »
Logged
So my crundles are staying intact unless they're newly spawned... until they are exposed to anything that isn't at room temperature.  This mostly seems to mean blood, specifically, their own.  Then they go poof very quickly.

Siquo

  • Bay Watcher
  • Procedurally generated
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #2717 on: July 27, 2012, 09:31:35 am »

Would any of you happen to have a grasp of quaternions?
I use them all the time, by waving my hands around and shouting "It's MAGIC!". (Unhelpful) Advice: Try to find the error by treating the built-in logic as magic boxes.
Logged

This one thread is mine. MIIIIINE!!! And it will remain a happy, friendly, encouraging place, whether you lot like it or not. 
will rena,eme sique to sique sxds-- siquo if sucessufil
(cant spel siqou a. every speling looks wroing (hate this))

Thief^

  • Bay Watcher
  • Official crazy person
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #2718 on: July 27, 2012, 09:57:35 am »

When working with rotations, most funky issues are caused by the order you apply Yaw/Pitch/Roll/Scale/Translate.
Logged
Dwarven blood types are not A, B, AB, O but Ale, Wine, Beer, Rum, Whisky and so forth.
It's not an embark so much as seven dwarves having a simultaneous strange mood and going off to build an artifact fortress that menaces with spikes of awesome and hanging rings of death.

alway

  • Bay Watcher
  • 🏳️‍⚧️
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #2719 on: July 27, 2012, 10:09:05 am »

Which is considered a valuable bit though? 0? 1?

The 1s of course.  What would you need the 0s for, there's nothing in them.


Would any of you happen to have a grasp of quaternions?  They're giving me some funky issues, and I don't think I understand them well enough to figure it out.

Edit: Oh, for anyone who hasn't heard of them, quaternions are super awesome for 3D rotation.  This article and the XNA Quaternion class were all I needed to get started using them, and they've proven pretty easy to use once the actual math gets abstracted away a bit.
http://web.archive.org/web/20101103233941/http://www.genesis3d.com/~kdtop/Quaternions-UsingToRepresentRotation.htm
Unfortunately the site itself it gone as of a few weeks ago, but the wayback version should help.
Logged

dreadmullet

  • Bay Watcher
  • Inadequate Comedian
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #2720 on: July 27, 2012, 03:09:43 pm »

Quaternions are simply the best thing. And like Siquo said, you should think of them as magical. They remind me of 4x4 matrices, in that I use them a lot but have no idea how they work.
Logged

Derekristow

  • Bay Watcher
    • View Profile
    • Steam ID
Re: if self.isCoder(): post() #Programming Thread
« Reply #2721 on: July 28, 2012, 12:12:12 am »

When working with rotations, most funky issues are caused by the order you apply Yaw/Pitch/Roll/Scale/Translate.

In this case, I'm actually converting the rotation of a "spherical camera" into a quaternion so that it works with some stuff I already had set up, then converting it back again.  The system works perfectly for everything else, but somewhere something is going awry and giving me some weird results.  Luckily, what I'm trying to do is relatively non-critical, and can be done in easier but less pretty ways.

tl;dr: I've tampered with forces beyond my control and can't figure out what's going wrong.

Edit:  On second thought, I'm going to strike the feature entirely, and do it differently instead.  Still would be nice to figure out what the issue is, but whatever.
« Last Edit: July 28, 2012, 12:57:27 am by Derekristow »
Logged
So my crundles are staying intact unless they're newly spawned... until they are exposed to anything that isn't at room temperature.  This mostly seems to mean blood, specifically, their own.  Then they go poof very quickly.

alway

  • Bay Watcher
  • 🏳️‍⚧️
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #2722 on: July 28, 2012, 12:02:39 pm »

I tend to avoid spherical coordinates like the plague they are. Between their gimbal lock issues and the general PITA they are to work with combined with the relative ease of doing everything with quaternions, I typically don't see a need to use them.
Logged

Derekristow

  • Bay Watcher
    • View Profile
    • Steam ID
Re: if self.isCoder(): post() #Programming Thread
« Reply #2723 on: July 28, 2012, 12:43:20 pm »

They work out pretty well for a camera because it's physically impossible to turn the thing the wrong way.  Up will always be up, no matter what, which makes for very nice and relatively easy to program camera controls.

For anything else though, I'd agree.  They're very limited in what they can do.
Logged
So my crundles are staying intact unless they're newly spawned... until they are exposed to anything that isn't at room temperature.  This mostly seems to mean blood, specifically, their own.  Then they go poof very quickly.

SolarShado

  • Bay Watcher
  • Psi-Blade => Your Back
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #2724 on: July 28, 2012, 11:45:33 pm »

Up will always be up, no matter what,

Unless you're in space
Logged
Avid (rabid?) Linux user. Preferred flavor: Arch

da_nang

  • Bay Watcher
  • Argonian Overlord
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #2725 on: July 30, 2012, 11:52:18 am »

TreeSets, the fuck do they work? (Java)
So I have problem, you see. (Or the program code that I was given has, grr...) Let's say you have a Region class. That class has a Set<Integerr> TreeSet storing the ID numbers of all the Buildings in that Region. And as is custom in OOP, this class has a getBuildings() that returns this TreeSet (Or specifically, a Set<Integer>).

Now I want to get these ID numbers out of that damn TreeSet so I can access the actual information about the Buildings using the supplied interface commands for accessing those buildings and then printing out a string containing the information of all the buildings in that Region.. So I read up on TreeSets to find out how to get the data out of it. Seems rather straightforward, just iterate through it and systematically append strings. Easy, right? Well, fuck no.

-code snip-
Now the DBInterface functions I dare not look at as they use things I haven't even heard of yet and seeing as how they were supplied to me I've assumed they're foolproof. You simply give it the id and it returns the Building through some magical way.

The problem here is that no matter what I do, it doesn't return that string, or if it does, there's no content in it. So either my head has become very thick or something is very wrong here.

EDIT: Turns out I was thick and had fucked up a for-block.
« Last Edit: July 30, 2012, 01:41:15 pm by da_nang »
Logged
"Deliver yesterday, code today, think tomorrow."
Ceterum censeo Unionem Europaeam esse delendam.
Future supplanter of humanity.

alway

  • Bay Watcher
  • 🏳️‍⚧️
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #2726 on: July 31, 2012, 11:36:16 am »

There's codeblocks IDE http://www.codeblocks.org/
Visual C++ Express Edition (aka, the free one) http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express

Codeblocks is probably a good one to start out with, as visual studio has a bunch of options which for a beginner can end up being a PITA. It also depends on what you want to develop.
Logged

MadocComadrin

  • Bay Watcher
  • A mysterious laboratory goblin!
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #2727 on: July 31, 2012, 12:37:54 pm »

Go for Code::Blocks. My first dabblings in C++ were with that and I got that plus MinGW to compile a Hello World program right out of the box.
Logged

Mego

  • Bay Watcher
  • [PREFSTRING:MADNESS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #2728 on: July 31, 2012, 05:41:17 pm »

If you're going the way of the Code::Blocks (which you should), make sure you grab the version with MinGW.

kaijyuu

  • Bay Watcher
  • Hrm...
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #2729 on: July 31, 2012, 07:46:47 pm »

Eww, Code Blocks. +At least it's better than Visual Studio, I suppose.


I haven't found a c++ IDE I'd say is universally awesome. I use some wacky one last updated in 2005, and a friend of mine uses the Qt IDE even for projects that don't use Qt. Code Blocks is widely used and you can get a lot of support for it, so it'd probably the best, despite me not really liking the interface.
Logged
Quote from: Chesterton
For, in order that men should resist injustice, something more is necessary than that they should think injustice unpleasant. They must think injustice absurd; above all, they must think it startling. They must retain the violence of a virgin astonishment. When the pessimist looks at any infamy, it is to him, after all, only a repetition of the infamy of existence. But the optimist sees injustice as something discordant and unexpected, and it stings him into action.
Pages: 1 ... 180 181 [182] 183 184 ... 796