Archive: help with scopes


14th February 2002 00:12 UTC

help with scopes
I'm making a rotating cube using one superscope per side. I created the sides but the visualation leaks through so the rear plains can be seen, visually distorting the cube shape. I messed with the set render mode a little and a bunch of other stuff. I want to make the cube solid and not transpartent, and I'm clueless. Please help me.


14th February 2002 00:40 UTC

I think it'll help if you change the color depending on what phase of the rotation each scope is at. I assume you're using a cosine/sine of a certain variable to rotate each side; therefore, use the same sine or cosine (or combo, dependant on how complicated your rotation) of the variable to effect the color.

Assuming t is the variable, and it's looping between 0 and 2*pi:

red=if(below(sin(t),0),1,0);

This will make the scope red if the sin(t) is between 0 and -1, and black when it's 0 to 1. If your rotating is complicated, you will need to find a way to find when (during the loop of t) a scope is "behind" another plane; though, it will always be a certain part of the loop.

I think you will have to use an additive set render mode, so that when drawing a black scope (therefore "unseen"), it does not overlap any other scopes.

Unfortunately, this is not complete. The entire area of the scope will be switching between red and black, rather than just part of the scope which is supposed to be "seen". I do not do much 3d in AVS, but I know you will need to use the variable i in the "red=" command. Maybe this problem will not even arise... I hope this helps a bit.


14th February 2002 04:24 UTC

To do actual solid 3D superscopes, you need to dynamically colour the lines white or black using a smart situation-dependant culling algorithm. A general solution is (imo) not possible in AVS. I have been able to get Z-buffered 3D scopes, in which each object has different colours (so it's not just a simple maximum filter), but it's slow as hell. Another method is to use a formula that fits the scene you have (e.g. my preset Groovy Saturn in Whacko AVS II).

However in your case, there's a *much* easier solution. To realise this, just take a die or something else that's cube-shaped. From any angle, you'll never see more than 3 sides of a cube. In some cases, you can even see just two or one. So you just make 3 superscopes that contain a set of synchronized angles, and wrap these angles so that they're always between -pi/2 and pi/2. If you pick the 3 superscopes so that no 2 form opposite sides of the cube, you'll get the illusion of a cube: when a face 'disappears' by rotating left, it just reappears as the opposite face on the right-hand side.


14th February 2002 04:39 UTC

Thanks alot guys. What I did was just use 27 (twenty-seven) superscopes for three sides of the cube. What I'm trying to do is simulate a rotating Rubik's cube. I made three superscopes be the center pieces for the viewable cube then remapped the 8 outer "cublets" to match the centers. As for getting it to fully rotate, (simulating 3d), my math skills are weak. As for the colors, I was trying to create the color to move very similar to the twisting of edges of a Rubik's cube, which I am completely lost on, maybe some kind of DM or just more math in the superscopes. Thanks again.