Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - zefoo

Pages: [1] 2 3 4 5 6
1
Off Topic / Issue rotating a point about an arbitrary axis.
« on: June 23, 2014, 06:55:35 PM »
So I have written this C++ program with SDL 2.0 and I'm trying to get it to display a point rotating about the arbitrary axis 1,1,1 much like this http://twist-and-shout.appspot.com/#0_0_0_1_1_1_1_1_0_45 but it is coming out with something completely different.

code:
http://pastebin.com/uqMxKEvJ

See any errors I have made?

2
I have a Toshiba Satellite P75-A7200 that I have just installed Ubuntu 14.04 on and it runs great. But the touchpad does not work. I plugged in a usb mouse and it worked fine but the laptop touchpad wont work. I tried everything I could find under the sun and it is detected and all and says its enabled but does not work. I have pressed fn f7 to enable the mouse and still nothing. Synaptics is installed im pretty sure to because I used synaptics --list or something like that and It worked fine. How can I fix it?

3
Games / Like DarkRP? Like Gmod?
« on: May 26, 2014, 09:24:10 PM »
Then why not join my darkrp server!
Its called Zefoo's DarkRP Server or the IP is just 76.25.34.149!

4
Off Topic / C++ 3D Rotation Help Needed.
« on: April 23, 2014, 11:42:13 AM »
How does one rotate a point in 3D space without gimbal lock?

All I have encountered is to use Quaternions so here is what I have tried.

Code: [Select]
#include <iostream>
#include <GLFW/glfw3.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>

#define PI 3.14159265

double getTime() {
return glfwGetTime();
}
float lastTime = glfwGetTime();
float getDelta() {
float time = getTime();
float delta = (time - lastTime);
lastTime = getTime();
return delta;
}

struct vector3f{
float x,y,z;
};
struct quaternion{
float x,y,z,w;
};
float getqlength(quaternion q1) {
return sqrt(q1.x*q1.x+q1.y*q1.y+q1.z*q1.z+q1.w*q1.w);
}
quaternion normalizeq(quaternion q1) {
quaternion nq;

float q1length = getqlength(q1);

nq.x = q1.x / q1length;
nq.y = q1.y / q1length;
nq.z = q1.z / q1length;
nq.w = q1.w / q1length;

return nq;
}
quaternion conjugateq(quaternion q1) {
quaternion nq;
nq.x = -q1.x;
nq.y = -q1.y;
nq.z = -q1.z;
nq.w = q1.w;
return nq;
}
quaternion mulq(quaternion q1, quaternion q2) {
quaternion nq;
nq.w = q1.w * q2.w - q1.x * q2.x - q1.y * q2.y - q1.z * q2.z;
nq.w = q1.x * q2.w + q1.w * q2.x + q1.y * q2.z - q1.z * q2.y;
nq.w = q1.y * q2.w + q1.w * q2.y + q1.z * q2.x - q1.x * q2.z;
nq.w = q1.z * q2.w + q1.w * q2.z + q1.x * q2.y - q1.y * q2.x;
return nq;
}
quaternion mulqv(quaternion q1, vector3f v) {
quaternion nq;
nq.w = -q1.x * v.x - q1.y * v.y - q1.z * v.z;
nq.w = q1.w * v.x + q1.y * v.z - q1.z * v.y;
nq.w = q1.w * v.y + q1.z * v.x - q1.x * v.z;
nq.w = q1.w * v.z + q1.x * v.y - q1.y * v.x;
return nq;
}
vector3f rotatev(vector3f v, vector3f axis, float angle) {
vector3f nv;

float sha = sin( (angle / 2)*(PI / 180));
float cha = cos( (angle / 2)*(PI / 180));


quaternion rotation;
rotation.x = axis.x * sha;
rotation.y = axis.y * sha;
rotation.z = axis.z * sha;
rotation.w = cha;
quaternion w = mulq(mulqv(rotation,v),conjugateq(rotation));

std::cout << w.x << "," << w.y << "," << w.z << " " << angle << " " << sha << " " << cha << "\n";

nv.x = w.x;
nv.y = w.y;
nv.z = w.z;
return nv;
}

vector3f p1;
vector3f p2;
vector3f pa;
float pang;

void init() {
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glFrontFace(GL_CCW);
glCullFace(GL_BACK);
glEnable(GL_CULL_FACE);
glEnable(GL_DEPTH_TEST);
p1.x = 0.0;
p1.y = 0.0;
p1.z = 0.0;
p2.x = 0.0;
p2.y = 0.2;
p2.z = 0.0;
pa.x = 0.0;
pa.y = 0.0;
pa.z = 1.0;
pang = 0;
}

void update(float delta) {
pang += 90 * delta;
if(pang > 360) {
pang -= 360;
}
p2 = rotatev(p2,pa,pang);
}

void render() {
glBegin(GL_POINTS);
glColor3f(0.0, 1.0, 0.0);
glVertex3f(p1.x, p1.y, p1.z);
glVertex3f(p2.x, p2.y, p2.z);
glEnd();
}

static void error_callback(int error, const char* description) {
    fputs(description, stderr);
}
static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) {
    if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
        glfwSetWindowShouldClose(window, GL_TRUE);
}
int main(void) {
    GLFWwindow* window;
    glfwSetErrorCallback(error_callback);
    if (!glfwInit())
        exit(EXIT_FAILURE);
    window = glfwCreateWindow(640, 480, "", NULL, NULL);
    if (!window)
    {
        glfwTerminate();
        exit(EXIT_FAILURE);
    }
    glfwMakeContextCurrent(window);
    glfwSetKeyCallback(window, key_callback);
init();
    while (!glfwWindowShouldClose(window))
    {
        float ratio;
        int width, height;
        glfwGetFramebufferSize(window, &width, &height);
        ratio = width / (float) height;
        glViewport(0, 0, width, height);
        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
        glMatrixMode(GL_PROJECTION);
        glLoadIdentity();
        glOrtho(-ratio, ratio, -1.f, 1.f, 1.f, -1.f);
        glMatrixMode(GL_MODELVIEW);
        glLoadIdentity();


update(getDelta());
render();

        glfwSwapBuffers(window);
        glfwPollEvents();
    }
    glfwDestroyWindow(window);
    glfwTerminate();
    exit(EXIT_SUCCESS);
}
So to my understanding that should give me a window with two points, one rotating around the other.

But, all i'm getting is one dot and the location of another point at 4.61497e+033,1.26933e-038,3.76462e-039 apparently...

What have I done wrong and/or how do I manage 3D rotation?

5
Creativity / FTDI and Arduino help needed
« on: January 31, 2014, 08:18:42 AM »
Made a Mintduino (http://makezine.com/projects/build-a-mintronics-mintduino/), plugged the FTDI into the board, Plugged the FTDI into the computer (usb), attempted to upload a sketch, tx LED blinks 3 times, Arduino IDE error (avrdude) “avrdude: stk500_getsync(): not in sync: resp=0x00”

im using a https://www.sparkfun.com/products/10524 for my processor
Tried everything it seems. Please help.

console output

http://pastebin.com/raw.php?i=1chs1eFH

6
Off Topic / nvm
« on: December 15, 2013, 06:19:35 PM »

nvm

7
Games / Zefoo's DarkRP server!
« on: October 16, 2013, 03:15:19 PM »
Fixed up with drugs, chairs, vehicles, dealers, and loads of other stuff! The ip is 75.71.195.86 and we would love to populate our city!

8
Off Topic / Do you know much about Ubuntu Server?
« on: October 15, 2013, 11:53:17 AM »
Then I would appreciate your help with this.

Quote
So I have a system of mine running Ubuntu server and I Installed steamcmd on it. Then I tried to run it and got this.

Code: [Select]
sudo ./steamcmd.sh
main.cpp (316)  : Assertion Failed: Couldn't chdir into the install path

Anyone know how to fix this?

9
So I have a system of mine running Ubuntu server and I Installed steamcmd on it. Then I tried to run it and got this.

Code: [Select]
sudo ./steamcmd.sh
main.cpp (316)  : Assertion Failed: Couldn't chdir into the install path

Anyone know how to fix this?

10
Games / Gmod Darkrp Server
« on: August 07, 2013, 11:32:23 PM »
76.25.34.149 is the ip if you would like to join.

11
Games / Vanilla Minecraft Server!
« on: July 27, 2013, 01:04:20 PM »
Its just a vanilla Minecraft 1.6.2 server. The IP is 76.25.34.149 and the port is the standard 25565. Its Just standard survival.

But
NO GRIEFING OR YOU WILL BE BANNED FOR LIFE!

So join, tell your friends, tell their friends, tell their friends friends.

12
Off Topic / How can I host a web server on my ps vita or ipod('s).
« on: July 19, 2013, 04:09:29 PM »
Can I download Debian or Ubuntu?
Can I Download a program for hosting a web server?

PS VITA Stuff:
I know I can run a linux os on a ARM® Cortex™- A9 core (4 core) (ubuntu serever or debian or android or something idk). I also know the GPU supports OpenGL ES 2.0.

I want to use some device I currently own that does not use as much power as my desktop to leave on 24-7 and host a web server on.
I got 2 crappy ipods which would be terrible web servers.
And a ps vita.

13
Games / Gmod DarkRP Server
« on: July 02, 2013, 10:27:31 PM »
Mods!
The server IP is 76.25.34.149
We would like more players!

Server will be down randomly between 7/2 and 7/3

Uploading Video Soon!

14
Off Topic / Math Help Needed
« on: July 02, 2013, 03:30:44 PM »
So I need to find the 3D location of point B... I need the equation also...

Sorry its not to scale but yea...
I think we need to split it into 2 dimensions like so... This is to find B's Z and X coordinates...


Lol none of them are to scale but yea.

And Point B can be anywhere, -10000, 10, 50,      I mean anywhere

15
Games / Tekkit Lite Server
« on: June 09, 2013, 02:14:03 PM »
Do you like nuclear reactors? Do you like dirt? Do you have minecraft?

Then download tekkit lite and join our server!
Tekkit Lite Website

The current IP address for today is 75.71.195.86 but tomorrow and then on it will be
76.25.239.212

It Will be up today and the up times from then on will be from a whole day or 12 hours.

Pages: [1] 2 3 4 5 6