Alright so I am programming in c#,
I have added
[url]http://dev.mysql.com/downloads/connector/net/1.0.html#downloads[/url]
Version 6.5.6 to the references for my program. However I get the problem
[img]http://puu.sh/2pjCA[/img]
When I make it so it doesn't get embedded
From:
[img]http://puu.sh/2pjDi[/img]
Into:
[img]http://puu.sh/2pjEm[/img]
It works fine, however I have used this before and it has never had to have that setting changed. Am I missing something or doing something wrong or missing another reference that allows Embed Interop
Talked to a few guys I know about why this would be and none of them could figure out why.
I am thinking that I am either missing another reference of some sort, or I misread it in the past and it actually has never allowed interop embed. Anyone have any insight on this?
[QUOTE=Goz3rr;40062455]I tried this, although this probably isn't how you use quats:
[code]Quaternion qX = Quaternion.CreateFromAxisAngle(Vector3.Up, MathHelper.ToRadians(_xRot));
Quaternion qY = Quaternion.CreateFromAxisAngle(Vector3.Left, MathHelper.ToRadians(_yRot));
_basicEffect.World = Matrix.CreateFromQuaternion(qX) * Matrix.CreateFromQuaternion(qY);[/code]
I don't think it's gimbal lock though. The problem is, i think that by transforming the matrix the axises also change, because while everything looks fine at the default angle, when you rotate the yaw by 90 degrees, pitch will still be the same movement, except it will look wrong since the camera position doesn't change, if that makes any sense[/QUOTE]
Don't multiply the quaternions as matrices, that undoes commutativity. Multiply them directly.
You can also just store one quaternion as current rotation of the cube, then *= it with the changes you want to apply in a given frame.
[QUOTE=TH3_L33T;40067315]Alright so I am programming in c#,
I have added
[url]http://dev.mysql.com/downloads/connector/net/1.0.html#downloads[/url]
Version 6.5.6 to the references for my program. However I get the problem
When I make it so it doesn't get embedded
From:
Into:
It works fine, however I have used this before and it has never had to have that setting changed. Am I missing something or doing something wrong or missing another reference that allows Embed Interop
Talked to a few guys I know about why this would be and none of them could figure out why.
I am thinking that I am either missing another reference of some sort, or I misread it in the past and it actually has never allowed interop embed. Anyone have any insight on this?[/QUOTE]
Just curious as to why you aren't using NuGet? That gets all dependencies and adds references properly to your app/web.config.
[QUOTE=SteveUK;40068888]Just curious as to why you aren't using NuGet? That gets all dependencies and adds references properly to your app/web.config.[/QUOTE]
-snip-
Problem I was having I guess just needed to have a project close and re-open and it worked again.
Thanks Steve! You not only helped fix my problem but you have shown some light onto NuGet for me!
I just wanna know what the hell am i doing wrong here
[code]
int Students [250];
char Grades [250] [12];
FILE *fop = fopen(fileopen ,"rt");
int counter = 0;
char* line = (char*)malloc(100);
while (1)
{
/* Read line into buffer */
if ((fgets(line, 100, fop) == NULL) || ferror(fop) || feof(fop))
{
break;
}
if (strcmp(line, "\n") != 0){
continue;
}
/* Scan the integer */
if (counter == 0) {
sscanf(line, "%d", &Students[0]);
} else {
sscanf(line, "\n%d", &Students[counter]);
}
/* Scan the 12 characters */
for (unsigned int j = 0; j < 12; ++j)
{
sscanf(line, " %c", &Grades[counter][j]);
}
counter++;
}
//check what's written
for(counter = 0; counter <= strlen(Students); counter++){
printf("%d", Students[counter]);
for(int j = 0; j < 12; j++){
printf(" %c", Grades[counter][j]);
}
printf("\n");
}[/code]
the part where it reads from a txt file and writes in arrays i also tried like this, but no luck
[code]
while(1){
if(fscanf(fop,"%d",&Students[counter]) == EOF){
break;
}
for(int j = 0; j < 12; j++){
fscanf(fop," %c",&Grades[counter][j]);
}
fscanf(fop,"\n");
counter++;
[/code]
[QUOTE=Tamschi;40068635]Don't multiply the quaternions as matrices, that undoes commutativity. Multiply them directly.
You can also just store one quaternion as current rotation of the cube, then *= it with the changes you want to apply in a given frame.[/QUOTE]
Alright, so now i'm doing
[code]
Quaternion qX = Quaternion.CreateFromAxisAngle(Vector3.Up, MathHelper.ToRadians(_leftRightRot));
Quaternion qY = Quaternion.CreateFromAxisAngle(Vector3.Left, MathHelper.ToRadians(_upDownRot));
_basicEffect.World = Matrix.CreateFromQuaternion(qX * qY);
[/code]
And left/right rotation works perfect (Even after rotating up down), but up/down depends on the way the cube is facing, when changing it to qY * qX, up/down works perfectly but now left/right breaks
@RandomDexter:
[code]
if (strcmp(line, "\n") != 0){
continue;
}[/code]
This is probably wrong. You want to check if strcmp() returns 0, because that means it succeeded. So change the != to an ==
[QUOTE=account;40073674]@RandomDexter:
[code]
if (strcmp(line, "\n") != 0){
continue;
}[/code]
This is probably wrong. You want to check if strcmp() returns 0, because that means it succeeded. So change the != to an ==[/QUOTE]
this is what i get :S
[img]http://shrani.si/f/2w/5i/15O2rf37/1/untitled.jpg[/img]
I need an easily understood tutorial on using github through git bash, it seems really complicated and I don't want to have to use a GUI.
[QUOTE=Shadaez;40075609]I need an easily understood tutorial on using github through git bash, it seems really complicated and I don't want to have to use a GUI.[/QUOTE]
[url]http://try.github.com[/url]
[editline]29th March 2013[/editline]
Also I suggest using git shell and not git bash. It's part of GitHub for windows, and GitHub for windows containts some kind of password manager so when you use Git shell you won't have to type in your password when committing to GitHub. I'm not sure if it can save credentials for hosts other than GitHub though.
[QUOTE=Goz3rr;40071605]Alright, so now i'm doing
[code]
Quaternion qX = Quaternion.CreateFromAxisAngle(Vector3.Up, MathHelper.ToRadians(_leftRightRot));
Quaternion qY = Quaternion.CreateFromAxisAngle(Vector3.Left, MathHelper.ToRadians(_upDownRot));
_basicEffect.World = Matrix.CreateFromQuaternion(qX * qY);
[/code]
And left/right rotation works perfect (Even after rotating up down), but up/down depends on the way the cube is facing, when changing it to qY * qX, up/down works perfectly but now left/right breaks[/QUOTE]
Ah, sorry, I misunderstood quaternion rotation. It's non-commutative too.
Instead of your _upDownRot and _leftRightRot, store a Quaternion _rot. Then you can add rotation with _rot *= deltaLeftRight * deltaUpDown; (could be _rot = deltaLeftRight * deltaUpDown * _rot;).
The two values you store at the moment are not enough to fully describe a rotation, that's why you can't apply additional rotation steps independently. The smallest possible representation are Euler angles with 3 values, the smallest mathematically useful one are Quaternions.
Edit: Wow, this isn't WAYWO. Guess now I have to actually HELP people with this reply.
[QUOTE=Shadaez;40075609]I need an easily understood tutorial on using github through git bash, it seems really complicated and I don't want to have to use a GUI.[/QUOTE]
Read the online [url=http://git-scm.com/book]Git book[/url]. You need to understand how to use Git to use Github.
I want to begin playing with graphics in C++ where do I begin?
[QUOTE=Two-Bit;40080984]I want to begin playing with graphics in C++ where do I begin?[/QUOTE]
If you are looking to do 2D graphics, you should take a look at [url=http://www.sfml-dev.org/]SFML[/url]. For 3D I recommend learning modern OpenGL.
[QUOTE=Tamschi;40080141]Ah, sorry, I misunderstood quaternion rotation. It's non-commutative too.
Instead of your _upDownRot and _leftRightRot, store a Quaternion _rot. Then you can add rotation with _rot *= deltaLeftRight * deltaUpDown; (could be _rot = deltaLeftRight * deltaUpDown * _rot;).
The two values you store at the moment are not enough to fully describe a rotation, that's why you can't apply additional rotation steps independently. The smallest possible representation are Euler angles with 3 values, the smallest mathematically useful one are Quaternions.[/QUOTE]
[code]
if (k.IsKeyDown(Keys.Left) && _prevK.IsKeyUp(Keys.Left))
_leftRightTarget -= 90;
if (k.IsKeyDown(Keys.Right) && _prevK.IsKeyUp(Keys.Right))
_leftRightTarget += 90;
if (k.IsKeyDown(Keys.Up) && _prevK.IsKeyUp(Keys.Up))
_upDownTarget -= 90;
if (k.IsKeyDown(Keys.Down) && _prevK.IsKeyUp(Keys.Down))
_upDownTarget += 90;
_prevK = k;
float _prevLeftRight = _leftRightRot;
float _prevUpDown = _upDownRot;
_leftRightRot = MathHelper.Lerp(_leftRightRot, _leftRightTarget, 0.25f);
_upDownRot = MathHelper.Lerp(_upDownRot, _upDownTarget, 0.25f);
_rot *= Quaternion.CreateFromAxisAngle(Vector3.Up, MathHelper.ToRadians(_leftRightRot - _prevLeftRight)) * Quaternion.CreateFromAxisAngle(Vector3.Left, MathHelper.ToRadians(_upDownRot - _prevUpDown));
_basicEffect.World = Matrix.CreateFromQuaternion(_rot);
[/code]
It works perfectly when going left right, but after going up/down once everything derps out again:
[url]https://dl.dropbox.com/u/8385549/Kuub/RotatingCube.exe[/url]
How to reflect object's angle when it hits wall?
[cpp]
// Spawn.
angle = (Math.PI/180) * (startangle-90);
// Tick (move forward).
x += Math.cos(angle)*speed;
y += Math.sin(angle)*speed;
// Hits wall.
angle = 180 - angle - 90;
[/cpp]
Currently randoms its angle when it hits wall.
[QUOTE=rute;40083571]How to reflect object's angle when it hits wall?
[cpp]
// Spawn.
angle = (Math.PI/180) * (startangle-90);
// Tick (move forward).
x += Math.cos(angle)*speed;
y += Math.sin(angle)*speed;
// Hits wall.
angle = 180 - angle - 90;
[/cpp]
Currently randoms its angle when it hits wall.[/QUOTE]
Why not use velocity instead of angles, all you'll need to do then is just invert it
If you do want to use angles, it's supposed to be angle = 180 - angle
[QUOTE=rute;40083571]How to reflect object's angle when it hits wall?
[cpp]
// Spawn.
angle = (Math.PI/180) * (startangle-90);
// Tick (move forward).
x += Math.cos(angle)*speed;
y += Math.sin(angle)*speed;
// Hits wall.
angle = 180 - angle - 90;
[/cpp]
Currently randoms its angle when it hits wall.[/QUOTE]
[img]http://upload.wikimedia.org/wikipedia/commons/1/10/Reflection_angles.svg[/img]
[quote=Wikipedia]In the diagram at [i][above][/i], a light ray PO strikes a vertical mirror at point O, and the reflected ray is OQ. By projecting an imaginary line through point O perpendicular to the mirror, known as the normal, we can measure the angle of incidence, θi and the angle of reflection, θr. The law of reflection states that θi = θr, or in other words, the angle of incidence equals the angle of reflection.[/quote]
With vectors, your wall has a normal [img]http://latex.codecogs.com/gif.latex?\mathbf{n}[/img] and your object's velocity is [img]http://latex.codecogs.com/gif.latex?\mathbf{v}[/img]. Then the new velocity [img]http://latex.codecogs.com/gif.latex?\mathbf{v%27}[/img] is defined as
[img]http://latex.codecogs.com/gif.latex?\mathbf{v%27}%20=%20\mathbf{v}%20-%202\frac{\mathbf{v}\cdot\mathbf{n}}{||\mathbf{n}||^2}\mathbf{n}[/img]
i.e. project the velocity onto the normal, and subtract the result twice from the original velocity
[QUOTE=mobrockers2;40075986]I'm not sure if it can save credentials for hosts other than GitHub though.[/QUOTE]
That's a standard feature if you use git bash. You simply edit the .ssh/config file like you would on Linux. Maybe GitHub client does the same thing.
In a 3D grid-like environment (Minecraft), using Java, what would be an effecient way to get the block touching the output face of the control block, and same for the block touching that block, and so on, and so forth. Basically going through a chain of blocks reliably. I already have the coordinates of the block itself, and where the block touching it is expected to be, I'm just not sure how to iterate through all that and report all that data back to the control block.
tried to do a recursive merge sort, did I fuck up?
(python)
[code]
def merge(list):
length = len(list)
if length <= 1:
return list
left = merge(list[length/2:])
right = merge(list[:length/2])
sort = []
while len(sort) < length:
if len(left) != 0 and len(right) != 0:
if left[0] < right[0]:
sort.append(left.pop(0))
else:
sort.append(right.pop(0))
else:
sort.extend(left + right)
else:
return sort[/code]
[URL]http://en.wikipedia.org/wiki/Merge_sort[/URL]
I have no idea what I'm doing
I did a bunch of asserts so I know it works, I just want to know if I butchered the efficiency somewhere or misunderstood what it's even doing
[editline]30th March 2013[/editline]
even if I failed implementing it, it worked first run and I'm proud of that
[QUOTE=Goz3rr;40082337][code]
if (k.IsKeyDown(Keys.Left) && _prevK.IsKeyUp(Keys.Left))
_leftRightTarget -= 90;
if (k.IsKeyDown(Keys.Right) && _prevK.IsKeyUp(Keys.Right))
_leftRightTarget += 90;
if (k.IsKeyDown(Keys.Up) && _prevK.IsKeyUp(Keys.Up))
_upDownTarget -= 90;
if (k.IsKeyDown(Keys.Down) && _prevK.IsKeyUp(Keys.Down))
_upDownTarget += 90;
_prevK = k;
float _prevLeftRight = _leftRightRot;
float _prevUpDown = _upDownRot;
_leftRightRot = MathHelper.Lerp(_leftRightRot, _leftRightTarget, 0.25f);
_upDownRot = MathHelper.Lerp(_upDownRot, _upDownTarget, 0.25f);
_rot *= Quaternion.CreateFromAxisAngle(Vector3.Up, MathHelper.ToRadians(_leftRightRot - _prevLeftRight)) * Quaternion.CreateFromAxisAngle(Vector3.Left, MathHelper.ToRadians(_upDownRot - _prevUpDown));
_basicEffect.World = Matrix.CreateFromQuaternion(_rot);
[/code]
It works perfectly when going left right, but after going up/down once everything derps out again:
[url]https://dl.dropbox.com/u/8385549/Kuub/RotatingCube.exe[/url][/QUOTE]
Sorry, XNA is picky regarding hardware so I can't run this. Try _rot = ... * _rot . (I can't remember the proper quaternion multiplication order.)
I think your rotations may also be far too fast to keep the errors down if you rotate more than one axis.
This doesn't seem like a reliable way to target an orientation because of rounding errors. If you want to flip the cube only in 90° angles it would be better to have 6*4 fixed orientation values and switch through them with the arrow keys, then switch on that to get the target quaternion and just use _rot = slerp(_rot, targetRot, 0.25f); (pseudocode) to get the new orientation.
[QUOTE=Tamschi;40092628]Sorry, XNA is picky regarding hardware so I can't run this. Try _rot = ... * _rot . (I can't remember the proper quaternion multiplication order.)
I think your rotations may also be far too fast to keep the errors down if you rotate more than one axis.
This doesn't seem like a reliable way to target an orientation because of rounding errors. If you want to flip the cube only in 90° angles it would be better to have 6*4 fixed orientation values and switch through them with the arrow keys, then switch on that to get the target quaternion and just use _rot = slerp(_rot, targetRot, 0.25f); (pseudocode) to get the new orientation.[/QUOTE]
Thanks! the _rot = ... * _rot seems to have fixed it, although when i press two keys at the same time (Up and left for instance), the cube ends up like this:
[img]http://puu.sh/2qCu9[/img]
[QUOTE=gparent;40090199]That's a standard feature if you use git bash. You simply edit the .ssh/config file like you would on Linux. Maybe GitHub client does the same thing.[/QUOTE]
Cool. I still like Git Shell better, it just looks nicer :v:
[QUOTE=mobrockers2;40093501]Cool. I still like Git Shell better, it just looks nicer :v:[/QUOTE]
Yeah, np. I use that feature to specify a ssh key coming from a regular user when using ssh as root to manage some system directories.
So, this isn't really a technical question: I wrote a wrapper around GNU units using Python. It feeds stuff to the console and extracts the output.
Is this subject to legal restrictions similar to linking? Does it count as using GNU units as if I were linking to some kind of units.a library? Or am I free to publish this as part of a larger MIT-licensed program?
[QUOTE=Eudoxia;40098933]So, this isn't really a technical question: I wrote a wrapper around GNU units using Python. It feeds stuff to the console and extracts the output.
Is this subject to legal restrictions similar to linking? Does it count as using GNU units as if I were linking to some kind of units.a library? Or am I free to publish this as part of a larger MIT-licensed program?[/QUOTE]
If you're piping text data into the program through a shell it's not linking under the GPL at least?
[editline]31st March 2013[/editline]
Or like, through file descriptors, I guess.
I'm new to programming and I've started learning python as my first language.
I got a beginner's book to python for first time programmers, so I'm learning the basics.
If anyone who is experienced with python would like to act as a kind of mentor for me, that would be really awesome. I'm in the process right now of making a text based adventure game. You can add me on steam or whatever if you'd want to, I would just ask you questions from time to time.
Sorry, you need to Log In to post a reply to this thread.