![]() |
#1 |
Junior Member
Join Date: Aug 2004
Posts: 19
|
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!! |
![]() |
![]() |
![]() |
#2 |
Junior Member
Join Date: Aug 2004
Posts: 19
|
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 |
![]() |
![]() |
![]() |
#3 |
Forum King
|
#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. "guilt is the cause of more disauders than history's most obscene marorders" --E. E. Cummings |
![]() |
![]() |
![]() |
#4 |
Whacked Moderator
Join Date: Jun 2001
Posts: 2,104
|
Please use 'Post a reply' instead of 'Post a new topic' to continue a discussion.
|
![]() |
![]() |
![]() |
#5 |
Major Dude
Join Date: Oct 2002
Location: The United Kingdom of Great Britain and Northern Ireland
Posts: 1,374
|
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. http://PAK-9.deviantart.com ...innit |
![]() |
![]() |
![]() |
#6 |
Junior Member
Join Date: Jul 2004
Location: Finland
Posts: 47
|
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. |
![]() |
![]() |
![]() |
#7 |
Major Dude
Join Date: Oct 2002
Location: The United Kingdom of Great Britain and Northern Ireland
Posts: 1,374
|
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. http://PAK-9.deviantart.com ...innit |
![]() |
![]() |
![]() |
#8 |
Major Dude
|
uh...i really dont understand
![]() On the other there should'nt even be a topic like this ![]() |
![]() |
![]() |
![]() |
#9 |
Forum King
|
praytell, ishan, how is this troubleshooting?
"guilt is the cause of more disauders than history's most obscene marorders" --E. E. Cummings |
![]() |
![]() |
![]() |
#10 |
Junior Member
Join Date: Aug 2004
Posts: 19
|
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? |
![]() |
![]() |
![]() |
#11 |
Major Dude
Join Date: Oct 2002
Location: The United Kingdom of Great Britain and Northern Ireland
Posts: 1,374
|
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.
http://PAK-9.deviantart.com ...innit |
![]() |
![]() |
![]() |
#12 |
Junior Member
Join Date: Aug 2004
Posts: 19
|
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! |
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|