Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Problem with tutorial

Author
Message
LadyCherry
21
Years of Service
User Offline
Joined: 31st May 2003
Location:
Posted: 1st Jun 2003 03:54
I dont know if it is said before but I was following the tutorial just fine all the way up to the Gosub part. All of a sudden a line like this shows up in the tutorial and its not even explained:
scale object int((Wrapvalue((Pn-9+x)*36))/36)+10,100+x*25,100+x*25,100+x*25

What in the world is this can someone explain it to me? Why would they assume we knew this without an explination? thank you for your time!

-Lady Cherry
bitJericho
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 1st Jun 2003 11:45
eek that is the worst line of code I've ever seen! Who in god's name wrote that? Lee if that was you...*shakes fist*
scale object int((Wrapvalue((Pn-9+x)*36))/36)+10,100+x*25,100+x*25,100+x*25

ugh...first of all...ugh...

SCALE OBJECT object, xvalue,yvalue,zvalue

this will scale an object by percentages... so SCALE OBJECT 1,100,100,100 will leave the object the same size..

as for the INT() command...that converts a value like 3.1415926536 into a whole number(or integer).. 3

WRAPVALUE() will change automatically resize a value no more then 360, and no less then 0

WRAPVALUE(100+300) = 40... i believe... this is good for keeping angles... like in this line of code

anglex# = WRAPVALUE(anglex# + 10)
XROTATE OBJECT 1, anglex#

without WRAPVALUE you would have gotten an error, because all angles must be equal to or greater than 0, and less then 361... WRAPVALUE will adjust the value in a variable so it meets those requirements...

as for the rest of the code...I couldn't tell you without knowing what tutorial it came from...

The 3D Modeler's Group : http://groups.yahoo.com/group/3dModeler/
The Unofficial DB Newsgroup : http://groups.yahoo.com/group/DBMag/
The Darthster
21
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 1st Jun 2003 13:54
int((Wrapvalue((Pn-9+x)*36))/36)+10

This is the object number, which returns a number between 10 and 19. The object is scaled proportional to x, by 100 + 25x in each dimension. Since x is used in the object number expression, it can be assumed that this line is part of a for x=0 to 9(?)...next x loop. As Pn (what?) changes, the object number that corresponds to a certain x changes by the same amount, so the size of the object changes. Basically it sets the size of 10 objects, whose sizes increase or decrease steadily as Pn changes, then cycle back round again.

That was worked out theoretically in my head, so it could all be completely wrong. Can you give us the context of the tutorial?

Once I was but the learner,
now, I am the Master.
LadyCherry
21
Years of Service
User Offline
Joined: 31st May 2003
Location:
Posted: 1st Jun 2003 22:21
Yes it was Written for the program tutorial that came with the product. Also it is on the main site at: http://darkbasic.com/create.php?f=3d_tutorials_19.php

And the snipit is below

Login to post a reply

Server time is: 2024-09-20 09:48:39
Your offset time is: 2024-09-20 09:48:39