» «

This section is for any editing topics that don't fit into any of the other forums, any questions on how to mod belong in Editing Discussion

##### Data Topics

The following topics contain extremely useful information:

# [REQ] Occlusion Tool

6 replies to this topic
spaceeinstein
• ##### spaceeinstein

巧克力

• Members
• Joined: 17 Jul 2003
•

### #1 Posted 01 May 2005 - 10:28 PM

I have been doing occlusions for a few months now. I have to find coordinates and calculate those to create an occlusion for Vice City. It was incredibly boring when I want to mass produce these things. I want a calculator that helps makes my life easier.

First I give you these coordinates:
X1 - -104.6
Y1 - -1256.1
X2 - -76.8
Y2 - -1221

Which will be created into this:
-90.7, -1238.55, -40.0, 27.8, 35.1, 218.4, 0.0

For the first number, find the average of X1 and X2.
Xavg - -90.7

For the second number, find the average of Y1 and Y2.
Yavg - -1238.55

Leave the third number alone.
-40.0

For the fourth number, find the difference of X1 and X2:
Xrang - 27.8

Fifth number, difference of Y1 and Y2:
Yrang - 35.1

Leave the rest alone.

Now, is it possible to make a program that can do all that?

Opius
• ##### Opius

General

• Members
• Joined: 27 Jun 2002
•

### #2 Posted 01 May 2005 - 11:29 PM

Working on a simple PHP script now. Gotta leave, so it might be around six hours or so.

Mike
• ##### Mike

Hustler

• The Connection
• Joined: 31 Mar 2002
•

### #3 Posted 02 May 2005 - 12:25 AM

Well.. i was kinda bored and i'm on my laptop. So i made one in mIRC script

/occlu to get it started

 CODE alias occlu {  if (\$dialog(occlu)) { dialog -v occlu }  else { dialog -md occlu occlu }}dialog occlu {  title "Occlusion calculator"  size 200 200 400 100  text "X1", 1, 10 10 11 20  edit "", 2, 23 10 60 20  text "X2", 3, 90 10 11 20  edit "", 4, 103 10 60 20  text "Y1", 5, 160 10 11 20  edit "", 6, 173 10 60 20  text "Y2", 7, 230 10 11 20  edit "", 8, 243 10 60 20  text "Output:", 9, 10 40 40 20  edit "", 10, 52 40 200 20  button "Process", 11, 310 10 50 20}on *:dialog:occlu:sclick:11:{  var %xavg = \$calc((\$did(occlu,2) + \$did(occlu,4)) / 2)  var %yavg = \$calc((\$did(occlu,6) + \$did(occlu,8)) / 2)  if (\$did(occlu,2) > \$did(occlu,4)) { var %xrang = \$calc(\$did(occlu,2) - \$did(occlu,4)) }  else { var %xrang = \$calc(\$did(occlu,4) - \$did(occlu,2)) }  if (\$did(occlu,6) > \$did(occlu,8)) { var %xrang = \$calc(\$did(occlu,6) - \$did(occlu,8)) }  else { var %xrang = \$calc(\$did(occlu,8) - \$did(occlu,6)) }  did -o occlu 10 1 %xavg %yavg -40.0 %xrang %yrang 218.4 0.0}

-Mike

spaceeinstein
• ##### spaceeinstein

巧克力

• Members
• Joined: 17 Jul 2003
•

### #4 Posted 02 May 2005 - 02:15 AM

Oh cool. Can you upload it? I don't know anything about programming.

Opius
• ##### Opius

General

• Members
• Joined: 27 Jun 2002
•

### #5 Posted 02 May 2005 - 04:47 AM

 CODE Opius's Cull.IPL Line Generator

X1:Y1:Z1:X2:Y2:Z2:

'. \$p1 .', '. \$p2 .', '. \$p3 .', '. \$p4 .', '. \$p5 .', '. \$p6 .'

';}else{echo '

No data posted or data not numeric

';}?>

I can have one uploaded and ready to run in about three hours. If you have a server running PHP, simply dump that code into an empty file, save it on the server, then visit the page.

Opius
• ##### Opius

General

• Members
• Joined: 27 Jun 2002
•

### #6 Posted 02 May 2005 - 07:27 AM

And here is your no-bullsh*t executable version.

spaceeinstein
• ##### spaceeinstein

巧克力

• Members
• Joined: 17 Jul 2003
•

### #7 Posted 02 May 2005 - 06:39 PM

Wow, thanks a lot. I can't believe I wasted a lot of time doing calculations via Calculator.

#### 1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users