[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
It's there any linear algebra guide for game programmers?
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /sci/ - Science & Math

Thread replies: 16
Thread images: 1
File: cube.gif (97 KB, 500x400) Image search: [Google]
cube.gif
97 KB, 500x400
It's there any linear algebra guide for game programmers?

I can't understand how those formulas work in a programming language.
>>
>>7914894
why do you want a linear algebra guide for programmers? just learn linear algebra and stop being lazy
>>
>>7914912
I can't understand how linear algebra can be translated into code.
>>
http://golibgen.io/view.php?id=800859
>>
>>7914918
Better just get a computer graphics book then, which lists pseudocode or openGL.
>>
Coding the Matrix
>>
>>7914894
>>7914918
Sadly, you're too retarded to make a game that has any sort of actual value. Just give up now and look into unskilled labor.
>>
>>7914972
nigger, I'm tired of being a baby using GM or unity.

I'm trying to improve.

so fuck off.
>>
>>7914976
Then teach yourself, if you don't understand how formulas "work in" a programming language, you probably have never even programmed.

So you're either lazy or retarded. Which one is it?
>>
learn matlab
>>
>>7914981
>come asking what's a good book that teaches linear algebra in computer graphics
>teach yourself
nigga u dumb.
>>
Just read ordinary linear algebra.
>>
>>7914988
keep telling yourself that.
you really want my help?
go to http://programming-motherfucker.com/, browse the resources, and learn the basics.
It will take some time, especially if you've never programmed before.
I recommend learning something like Lisp first, just to understand the basics of computer languages, just google "SICP" for a good book.

If you think you're set, go on to C++ to begin OpenGL programming (DirectX and C# is for lazy faggots).

Good luck, and I mean that in the most sarcastic possible way. Hell, you probably won't even listen to this post
>>
>>7914918
then your problem is not with linear algebra, but with programming. learn how to program.
>>
I tried to make a program thats project a unit cube on the computer screen. In some angles and positions it works but in some it won't.
q=[1/2 1/2 7]'; %your position
phi=[40 -85]'; %your head angle


c1=cos(phi(1)*pi/180);
s1=sin(phi(1)*pi/180);
c2=cos(phi(2)*pi/180);
s2=sin(phi(2)*pi/180);
k=0.5*[c2*c1 c2*s1 s2]';
R=[0 -1 0 ; 0 0 1];
%%M=[ c2*s1 -c2*c1 s2*s1 ; -s2 -s2 c2 ];
%PA=inv([c2*c1 -s1 -s2*c1 ;c2*s1 c1 -s2*c2 ;s2 0 c2 ]);

%P=inv([c2*c1 -c2*s1 -s2*c1 ;c2*s1 c1*c2 -s2*c2 ;s2 s2 c2 ]);

%P=([c2*c1 s1 s2*c1 ;-c2*s1 c1 s2*c2 ;-s2 0 c2 ]);
%P=[c2*c2 s1 s2*c1 ; -c2*s1 c1 s2*s1 ; -s2 0 c2 ];
P=[c2*c1 s1 s2*c1 ; -c2*s1 c1 -s2*s1 ; -s2 0 c2];
M=R*P;
%%%%%%%%%%%%
%%%%%%%%%%%%
p1=[0 0 0 ]';
pp1=M*((p1-q)*(dot(k,k)/dot((p1-q),k))-k);
%%%%%%%%%%%%
p2=[1 0 0 ]';
pp2=M*((p2-q)*(dot(k,k)/dot((p2-q),k))-k);
%%%%%%%%%%%%
p3=[0 1 0 ]';
pp3=M*((p3-q)*(dot(k,k)/dot((p3-q),k))-k);
%%%%%%%%%%%%
p4=[1 1 0 ]';
pp4=M*((p4-q)*(dot(k,k)/dot((p4-q),k))-k);
%%%%%%%%%%%%
p5=[0 0 1 ]';
pp5=M*((p5-q)*(dot(k,k)/dot((p5-q),k))-k);
%%%%%%%%%%%%
p6=[1 0 1 ]';
pp6=M*((p6-q)*(dot(k,k)/dot((p6-q),k))-k);
%%%%%%%%%%%%
p7=[0 1 1 ]';
pp7=M*((p7-q)*(dot(k,k)/dot((p7-q),k))-k);
%%%%%%%%%%%%
p8=[1 1 1 ]';
pp8=M*((p8-q)*(dot(k,k)/dot((p8-q),k))-k);
%%%%%%%%%%%%
x=[pp1(1) pp2(1) pp3(1) pp4(1) pp5(1) pp6(1) pp7(1) pp8(1) ]';
y=[pp1(2) pp2(2) pp3(2) pp4(2) pp5(2) pp6(2) pp7(2) pp8(2) ]';
x=round(x,3);
y=round(y,3);


scatter(x,y);
axis([-0.16 0.16 -0.09 0.09]);
>>
>>7914918
Then you suck at coding.
Thread replies: 16
Thread images: 1

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.