39 lines · 673 B · Text
RawDownload
// vec3 is a primitive type@(1,0,0) => vec3 a;// declare another@(0,1,0) => vec3 b; // add thema + b => vec3 sum;// differencea - b => vec3 diff;// cross producta * b => vec3 c; // print sum!<<< "sum:", sum >>>;// print difference<<< "diff:", diff >>>;// print cross product<<< "cross product:", c >>>; // array[ a, b, @(-1,1,0) ] @=> vec3 group[];// print them<<< group[0], group[1], group[2] >>>; // another vvec3 v;// set valuev.set( 2,2,2 );// print magnitude<<< "magnitude:", v.magnitude() >>>;// normalizev.normalize();// print vector<<< "normalize:", v >>>; // multiply5 * v => vec3 v2;// print result<<< "scalar multiply:", v2 >>>;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t