Loading the Environment

Create a 3D RPG Game with THREE.js Moving Around Your Environment
2 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$69.99
List Price:  $99.99
You save:  $30
€66.88
List Price:  €95.55
You save:  €28.66
£55.51
List Price:  £79.30
You save:  £23.79
CA$99.32
List Price:  CA$141.90
You save:  CA$42.57
A$110.04
List Price:  A$157.20
You save:  A$47.16
S$93.93
List Price:  S$134.19
You save:  S$40.26
HK$544.21
List Price:  HK$777.47
You save:  HK$233.26
CHF 63.01
List Price:  CHF 90.03
You save:  CHF 27.01
NOK kr779.13
List Price:  NOK kr1,113.09
You save:  NOK kr333.96
DKK kr498.87
List Price:  DKK kr712.70
You save:  DKK kr213.83
NZ$122.57
List Price:  NZ$175.11
You save:  NZ$52.54
د.إ257.07
List Price:  د.إ367.26
You save:  د.إ110.18
৳8,516.16
List Price:  ৳12,166.46
You save:  ৳3,650.30
₹6,083.86
List Price:  ₹8,691.60
You save:  ₹2,607.74
RM311.14
List Price:  RM444.50
You save:  RM133.36
₦105,695.39
List Price:  ₦150,999.89
You save:  ₦45,304.50
₨19,570.57
List Price:  ₨27,959.15
You save:  ₨8,388.58
฿2,358.03
List Price:  ฿3,368.76
You save:  ฿1,010.73
₺2,538.83
List Price:  ₺3,627.05
You save:  ₺1,088.22
B$400.73
List Price:  B$572.50
You save:  B$171.76
R1,286.57
List Price:  R1,838.04
You save:  R551.46
Лв130.83
List Price:  Лв186.91
You save:  Лв56.08
₩100,831.17
List Price:  ₩144,050.71
You save:  ₩43,219.53
₪249.61
List Price:  ₪356.60
You save:  ₪106.99
₱4,071.42
List Price:  ₱5,816.56
You save:  ₱1,745.14
¥10,627.83
List Price:  ¥15,183.26
You save:  ¥4,555.43
MX$1,418.09
List Price:  MX$2,025.94
You save:  MX$607.84
QR255.49
List Price:  QR365
You save:  QR109.51
P967.51
List Price:  P1,382.22
You save:  P414.70
KSh9,046.20
List Price:  KSh12,923.70
You save:  KSh3,877.50
E£3,542.20
List Price:  E£5,060.50
You save:  E£1,518.30
ብር8,997.14
List Price:  ብር12,853.61
You save:  ብር3,856.46
Kz63,830.88
List Price:  Kz91,190.88
You save:  Kz27,360
CLP$66,347.02
List Price:  CLP$94,785.52
You save:  CLP$28,438.50
CN¥509.52
List Price:  CN¥727.91
You save:  CN¥218.39
RD$4,350.49
List Price:  RD$6,215.25
You save:  RD$1,864.76
DA9,436.68
List Price:  DA13,481.55
You save:  DA4,044.87
FJ$160.86
List Price:  FJ$229.81
You save:  FJ$68.95
Q540.79
List Price:  Q772.59
You save:  Q231.80
GY$14,665.04
List Price:  GY$20,950.95
You save:  GY$6,285.91
ISK kr9,811.89
List Price:  ISK kr14,017.59
You save:  ISK kr4,205.70
DH698.29
List Price:  DH997.60
You save:  DH299.31
L1,305.42
List Price:  L1,864.97
You save:  L559.54
ден4,115.28
List Price:  ден5,879.23
You save:  ден1,763.94
MOP$561.64
List Price:  MOP$802.38
You save:  MOP$240.74
N$1,292.07
List Price:  N$1,845.90
You save:  N$553.82
C$2,579.14
List Price:  C$3,684.65
You save:  C$1,105.50
रु9,738.38
List Price:  रु13,912.57
You save:  रु4,174.18
S/259.30
List Price:  S/370.44
You save:  S/111.14
K281.92
List Price:  K402.76
You save:  K120.84
SAR262.49
List Price:  SAR375.01
You save:  SAR112.51
ZK1,971.40
List Price:  ZK2,816.41
You save:  ZK845
L332.89
List Price:  L475.58
You save:  L142.68
Kč1,677.24
List Price:  Kč2,396.16
You save:  Kč718.92
Ft26,868.69
List Price:  Ft38,385.49
You save:  Ft11,516.80
SEK kr749.97
List Price:  SEK kr1,071.44
You save:  SEK kr321.46
ARS$74,145.65
List Price:  ARS$105,926.90
You save:  ARS$31,781.25
Bs486.09
List Price:  Bs694.44
You save:  Bs208.35
COP$289,193.83
List Price:  COP$413,151.75
You save:  COP$123,957.92
₡35,501.02
List Price:  ₡50,717.92
You save:  ₡15,216.89
L1,786.93
List Price:  L2,552.87
You save:  L765.93
₲553,969.11
List Price:  ₲791,418.37
You save:  ₲237,449.25
$U3,026.99
List Price:  $U4,324.45
You save:  $U1,297.46
zł278.10
List Price:  zł397.30
You save:  zł119.20
Already have an account? Log In

Transcript

In this video, we're going to load the actual environment we're going to use in the game. We now have a if you look at version three folder, and the game dot j s, there is now a load environment method. And that's loaded in the FBX. exe file environment dot SPX. The first thing we do in that is allow it to receive shadows. scale it down slightly 2.81 would be exactly the size that it was created out.

Give it a name and we iterate through all the children of the of the FBX. exe file is a mash and includes the name main. And we set cache shadow receive shadows to true inclusive Name proxy, which we'll come to in the next video, then we set each material to be invisible material dot visible equals false. When we do that, we get that and I'm sure you can spot a problem. Namely, our character is walking through our set. Now we could create a ray caster based on the geometry of the environment.

The problem is, there's an awful lot of polygons in there. And so the ray caster has to ultimately find every single one of those polygons to check whether or not it's in the direction of the ray There is a way out of that. And in the next video we're going to look at how we resolve that problem.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.