Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Any octave coders round ere?

Name: Asuomynon 2012-12-13 21:31

Just think, it could be the next C ;D
But seriously, I'm bored... And I already have a very rough 3d (point) rendering code. Any thoughts on how to get it doing, well, more? (ie lines, polygons, etc) ?

Name: Anonymous 2012-12-13 21:35

;D
Fuck off.

Name: Anonymous 2012-12-13 21:46

>>2 is that all you got? omg lol

Name: Anonymous 2012-12-13 21:47

I read that as ``Any octave corner rounders here?''

Name: Anonymous 2012-12-13 21:53

>>4 that'll do.
So, First problem: How to fill in a line between two points (preferably in vectorized form) on a finite grid (a matrix)?

Name: Anonymous 2012-12-13 21:54

>>5
Corner rounder means web ``developer''.

Name: Anonymous 2012-12-13 22:09

Ah, learn something erryday =) here's a taste of octave (kinda salty, like all good languages ;)


vw = [1,20,1,20,1; 2,19,2,19,1; 2,10,1,10,4; 2,9,2,9,0; 3,5,15,20,4; 2,4,16,19,0; 1,1,1,1,4];

wmat = worldGen(vw);

myPos = [-10, 7, 5];

myPos2 = [-5, 6, 10];

myFix = [40, 5, 5];

imgXY = projectimage(wmat, [myPos; myFix], 0.00);

img2XY = projectimage(wmat, [myFix; myPos2], -0.05);


figure(1);

hold off;

plot([1,-1], [1,-1], 'k+');

hold on;

plot(imgXY(:, 1), imgXY(:, 2), 'r+');

Name: Anonymous 2012-12-13 22:16

rather crappy (but still...) visualization
http://img.techpowerup.org/121213/4anon.jpg

Name: Anonymous 2012-12-13 23:33

...aand, that is probably 1/6th of the entire script used to generate the pic. Worldgen does a quick mapping from the shorthand v-dub representation to a secondary 'flatland' matrix rep, and then Projectimage does all the work, namely Getxyrot (calculates x & y rotation from [mypos] - heading default to heading [myfix] ), Makeworldxyz turns the flatland to a Nx3 point matrix and translates from default to mypos, Applyxyzrot does the final matrix(-value) rotations, and then projectimage finally wipes off the z-values and returns the 2d points.
So, i'm kind of hoping if all that is do-able (in octave / efficiently), then why not be able to do more?

Name: Anonymous 2012-12-14 1:58

hmm, i found one way of doing, well something at least, using two (kind of dumb) matrices to store x and y co-ords, and a kernel =)
result : http://img.techpowerup.org/121214/myfade.jpg

that might not sound dumb, but they are storing their own indices, eg mx(1,1) = 1, mx(1,2) = 2 // my(1,1) = 1, my(2,1) = 2, etc...,  which seems kind of insane but works nicely, and sure saves looping over all 2500 elements for a tiny 50x50 px image

Name: Anonymous 2012-12-14 2:36

I don't know how to code octaves, but I do play octaves well on the piano.  I can play whole pages of octaves on fortissimo without getting tired!

Name: Anonymous 2012-12-14 3:55

>>11 nice

myFade rendering demo v1.1

nmat = [1:500];
nmat = nmat(ones(500,1),:);
nmat1 = sqrt((nmat .- 120).^2 .+ (nmat' .- 140).^2);
nmat2 = sqrt((nmat .- 220).^2 .+ (nmat' .- 340).^2);
nmat3 = sqrt((nmat .- 320).^2 .+ (nmat' .- 140).^2);
nmatx(:,:,1) = 1 .- (nmat1 ./ 200);
nmatx(:,:,2) = 1 .- (nmat2 ./ 250);
nmatx(:,:,3) = 1 .- (nmat3 ./ 150);
imshow(nmatx);

Name: Anonymous 2012-12-14 5:37

kind of accidental, but anyway
http://img.techpowerup.org/121214/sphere.jpg

Name: Anonymous 2012-12-14 12:17

U MENA MATLAB?

Name: Anonymous 2012-12-14 16:05

>>12
wtf are .- .^ ./? Ugliest language sine OcaML.

Name: Anonymous 2012-12-14 16:10

>>15
Prepending a dot to the operator means that it applies the operation to each element of the matrix.

Name: Anonymous 2012-12-14 21:31

>>16 nailed it
>>14 think free matlab

almost got (basic) polygons working.. (but first here's another canvas-6-esque script)


function ret = autopainter(imSize)

point3 = [100.1,100.5; 20.0,15.0; 150,200];

nmat = [1:imSize];

nmat = nmat(ones(imSize,1),:);

tx = atan2(nmat .- point3(1,1) , nmat' .- point3(1,2)) .* (180 / pi) .+ 180;

imshow (tx ./ 360)

ret = tx;

endfunction;

Name: Anonymous 2012-12-15 7:44

still chasing a working polygon.. (read: i can't draw triangles properly yet.....) but instead, another lovely graphic (from my old acer // canvas-6 never looked this good !! )

http://img.techpowerup.org/121215/uber.jpg

Name: Anonymous 2012-12-15 13:14

>>1 I actually have been using Octave at work for some machine learning stuff.  Nice little language.

>>14 MOAR LIEK SCATLAB LOL!!!11ONE

Name: Anonymous 2012-12-15 14:22

octave is poor man's matlab

Name: Anonymous 2012-12-15 15:38

>>19
You have not ``used Octave at work for some machine learning stuff.''
You just watched the two first lessons of Machine Learning in Coursera. Your lie was sweet.

Name: Anonymous 2012-12-15 20:05

>>20
Matlab is poor man's closed-source spyware.

Name: Anonymous 2012-12-15 22:15

this

Name: Anonymous 2012-12-16 3:31

>>20
octave is poor man's matlab
just add QTOctave and then its the same

Name: Anonymous 2012-12-16 4:27

>>24
it's not. I hate the fact that the fsf is interested mostly in replacing non free software instead of offering better alternatives to  it. Due to this, free software is usually a couple of steps behind proprietary software.

Name: Anonymous 2012-12-16 4:42

Octave is the plebeian's assembly language.

http://www.youtube.com/watch?v=LSAJTQiQ0DA

Name: Anonymous 2012-12-16 6:53

>>25
I hate the fact that the fsf is interested mostly in replacing non free software instead of offering better alternatives to  it. Due to this, free software is usually a couple of steps behind proprietary software.
Its not a couple steps behind or any steps behind. People are ingrained with the corporate mentality that individuals cannot defeat the power of industry. For the most part that is true, an individual cannot design his/her own car, airplane, medicine, washingmachine, or anything and expect it to compete with the full infrastructure of design and production that goes on in a large company. But this is not true with software. Computers are universal, the same computer in your cellphone can (and did) launch rockets that put a man on the moon. Not only is software quality of open source software as good as commercial, it is often better as there are no funding restraints or supervisors who allocate design resources. An open source programmer is open to experiment with things that would never be approved in a commercial environment. For this reason many major software companies give free rein to their programmers to submit ideas. Most major software companies like MS, Apple, HP, Sun started out not as a corporation but just a group of programmers who had an idea for a product. We refer to such small companies now as startups. Companies that lose this startup mentality and use normal corporate heirarchy of design get bogged down and fall behind which is what is happening to MS.

Name: Anonymous 2012-12-16 9:23

>>27
Companies that lose this startup mentality and use normal corporate heirarchy of design get bogged down and fall behind which is what is happening to MS.
Is that why Windows 8 came out with its new shitty Metro interface? I wouldn't be surprised if MS looked at various X11 tiling window managers and used them as "inspiration" to replace the last somewhat sane part of Windows.

Name: Anonymous 2012-12-16 9:47

>>25
If you had to convince a university or a corporation to get rid of Matlab, what would you propose to use as a replacement for Matlab?

It's insane to believe that they would use anything that's not Octave if they actually replaced Matlab with anything. It's practically and logistically impossible to train a bunch of old professors, change the structures of all the courses etc to use something new with reasonable use of resources.

Name: Anonymous 2012-12-16 11:36

If you had to convince a university or a corporation to get rid of Matlab, what would you propose to use as a replacement for Matlab?
http://esolangs.org/wiki/CLCLC-INTERCAL
(1) PLEASE STASH ,1
DO ,1 <- .1
DO .1 <- #1
PLEASE REINSTATE (2)
MAYBE NOT .1 <- #0
DO ,1 SUB .2 WHILE ABSTAIN FROM (2)
(2) PLEASE GO BACK
PLEASE DO RETRIEVE ,1
DO GO AHEAD
DO RESUME #1

Name: Anonymous 2012-12-16 21:57

>>26 I can only hope octave will be able to paint the screen nearly as quickly as this one day soon. Plebian is good though, i'd say the greatest downside of assembly is that it is just too exotic.
>>25, 27 Closed source 'should' be a step or two ahead of open source, since there is an open source reference / standard, doing worse than the freely available standard, in theory shouldn't happen..
Anyway, here's my first working polygon script =)

function [atx, atz] = getAngles(pointmat)
p2 = pointmat([2:end,1],:) .- pointmat(1:end,:);
tx = 360.0 .- (atan2(p2(:,1), p2(:,2)) .* (180.0 / pi) .+ 180.0);
tx([2,3,1],2) = mod(tx + 180.0, 360)
zero_broken_angle =  (abs(tx(:,1) .- tx(:,2)) < 180)
greaterFirst = tx(zero_broken_angle, 1) > tx(zero_broken_angle, 2)
atx = tx(zero_broken_angle, greaterFirst)
patx = [1:3];
patz = patx(zero_broken_angle);
atz = [patz(greaterFirst), patz(greaterFirst==0)]
if (sum(greaterFirst==0) > 0)
  aty(:,[2,1]) = tx(zero_broken_angle, greaterFirst == 0)
  endif;
atx = [atx, aty]
endfunction

function ret = autopainterpolyX(imSize)
point3 = [400,250; 200,200; 250,350;];
[rx, rz] = getAngles(point3)
nmat = [1:imSize];
nmat = nmat(ones(imSize,1),:);
tx = 360 .- (atan2(nmat .- point3(rz(1),1) , nmat' .- point3(rz(1),2)) .* (180.0 / pi) .+ 180);
tx2 = 360 .- (atan2(nmat .- point3(rz(2),1) , nmat' .- point3(rz(2),2)) .* (180.0 / pi) .+ 180);
tz = +(tx < rx(1,1) & tx > rx(1,2)) & (tx2 < rx(2,1) & tx2 > rx(2,2));
imshow(tz);
endfunction;

Name: Anonymous 2012-12-17 22:39

le bump, mainly because i haven't given up yet...
current progress : http://img.techpowerup.org/121217/nu.jpg
100 (random) polygon test took 12.2sec for 800x800 px (above), 6.4 sec for 600x600, and 1.6 sec for 300x300

Name: Anonymous 2012-12-17 22:53

>>32
le bump
Fuck off.

Name: Anonymous 2012-12-18 0:21

Name: Anonymous 2012-12-18 6:51

>>31
The whole point of open source is that many hands can do it better and faster.

Don't change these.
Name: Email:
Entire Thread Thread List