Archive: trying to make a tunnel... just trying...


17th August 2004 19:35 UTC

trying to make a tunnel... just trying...
I'm trying to make a tunnel using 3d dynamic movement, but i can't do it... I'm parametrizing it using the x coord as the angle and the y coord as the distance

The code is like this:

pixel:

x1=cos(x*$PI);
y1=cos(x*$PI);
z1=y+1;

x=x1/z1;
y=y1/z1

Anyone can help me, pliz??

Thx!!


17th August 2004 19:41 UTC

A mistake in the code before...
Sorry!! The correct code I have is

pixel:

x1=cos(x*$PI);
y1=sin(x*$PI);
z1=y+1;

x=x1/z1;
y=y1/z1


18th August 2004 02:45 UTC

#1: use the edit button
#2: if you can't use the edit button, use the reply button
#3: no more than one exclamation point or question mark is ever needed. seriously.

oh, and regarding your other post, pliz learn how to spell. thx.


18th August 2004 04:29 UTC

Please use 'Post a reply' instead of 'Post a new topic' to continue a discussion.


18th August 2004 08:08 UTC

It seems to me you've taken a fake 3D plane, and added some basically circular paramaterisation to the beginning. Thats a pretty poor effort.

A propper 3D DM will alow you to shift the location and direction of the camera, the typical approach is to pass the x and y through a serious of rotation matricies (3 for rotation in all axis) and then raytrace a shape by entering the equation in terms of x and y (you'll need to sit down with a piece of paper and work it out) then offset by the camera location and project the result to 2D (with a projection dependant on the type of texturing you want to do)....basically theres a lot to it, and your 5 lines of code aren't even close.

I would type a huge explanation of 3D coding in AVS to make myself look cool and knowledgable, but I'm sure if you search the forum you'll find more than one.


18th August 2004 08:17 UTC

for a simple tunnel effect you'd want to do something like this:

x=f(angle relative to center)
y=g(distance from center)


Where f and g are 2 appropriate functions. Below is an example that works:

r=atan2(y,x);
d=sqrt(sqr(x)+sqr(y));
x=abs(r*4/$pi); //could also just be r but this looks better...
y=1/d;


Then to avoid the aliasing noise near the center you might want to set alpha to some function of d.


18th August 2004 08:37 UTC

I meant to say, since your code isn't actually dynamic (and it's a hack so it's never going to be) you might as well stick it in a movement, it'll be faster and crisper. Although you cant alpha blend.

That goes for vanderphunck's 'tunnel effect' too.


18th August 2004 09:13 UTC

uh...i really dont understand:hang: these topics should be in the troublshooting section, they just crap up the main forum.
On the other there should'nt even be a topic like this:rolleyes: this has been discussed many times before*sigh*


19th August 2004 00:34 UTC

praytell, ishan, how is this troubleshooting?


19th August 2004 18:53 UTC

First of all, I'll try to remember all the things that you are cmplainig of. Sorry! (You see? Only one exclamation ;) )

I know that my try is quite poor. It was my firts aprox. Every adventure requires a first step! I'm not sure of what do you mean by raytrace the surface. I think that is finding the 3D coords of the surface for every pixel of the window. Is this true?

Thx for that tunnel vanderphunk! That isn't what I'm searching but thankyou anyway.

Here's an AVS that i made recently. Can somebody give his opinion?


20th August 2004 06:08 UTC

It can be a bit frustrating when all people do is complain...so here's another one! Presets should be posted in the 'AVS Presets' sub-forum. As for your fisrt step into 3D, I suggest you start by trying to make a 3D superscope, as they are a little simpler and make the transition to a 3D DM a bit easier. Again, just search the forum for 3D tutorials, I'm sure there are lots of them... then again there might not be since I've never looked.


21st August 2004 19:16 UTC

Ok! I'm receiving some information these days. Finally I've done a 3D DM! Thanks to unconed for his explanation! I posted the preset in the correct forum (I think), so every opinion, correction and optimisation is welcome.
Now I will start working on fish eye projection.
Thank you all and c u!