Archive: problem with ssc


5th December 2004 18:43 UTC

problem with ssc
i tried to make a nice 3d ssc with the megabuf-thing. that works so far. but when the scope gets larger (you'll see what i mean when you download the attached file) it sometimes gets behind the camera. then those ugly lines appear. i have tried different things to get rid of them but none of them worked. i hope someone can help.


5th December 2004 21:05 UTC

some veeeeery familiar code here :p. i had also an idea to do a version like this, but I liked my original version more. actually i get no lines you described, but I see no line skipping in the last scope, so maybe that is your problem.


5th December 2004 22:35 UTC

yes i tried the method you used in your new pack :D (i try different things for more than a week now so i look in every preset in wich a ssc moves behind the camera ;) ). i have seen now that i used it wrong :P . now i modyfied it so it should work now but it doesn't. so i have to go on trying different things .... or anyone can help me :D


6th December 2004 01:52 UTC

You are right in useing skip, the hard part is figuring out at what point you need to skip. You have to remeber you need to skip both positive and negative z values. (abs value)
I don't remeber were the cutoff is, but it's something like that.


6th December 2004 02:25 UTC

nice scope idea :)
about the skip... use a threshold that is a bit above 0.
it depends on the scale of your coordinates.
also, use this piece of code for skipping, so a line is skipped when either of its end points is behind the camera.


nskip=above(zvalue,0.1234);
skip=nskip+lskip;
lskip=nskip;


btw, if your code becomes more complex and you need loops, ifs with code in them, do a lot of megabuf assignments or simply want to shorten your code, you might be interested in this APE :)

6th December 2004 10:59 UTC

one of the problems is that a line can span 'from' behind the camera or 'to' behind the camera, you need to account for both cases. The skip if z is above a certain number method will still work, but only if your lines are pretty short. To be sure you can say skip if z>longest length a line will be


6th December 2004 15:25 UTC

that's exactly what my piece of code takes care of, pak ;)


6th December 2004 17:41 UTC

I get bored quickly, I usually only read the first couple of posts before I blurt out a reply


6th December 2004 19:43 UTC

thanks for all the replies. havn't tried it yet but i will do that later. :D