Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
webgl25
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Villard PierreFrederic
webgl25
Commits
9961e312
Commit
9961e312
authored
2 months ago
by
Romain
Browse files
Options
Downloads
Patches
Plain Diff
toit
parent
79b6b218
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ALVARIZA-BILLAR_DESERT_KANY/script.js
+22
-4
22 additions, 4 deletions
ALVARIZA-BILLAR_DESERT_KANY/script.js
with
22 additions
and
4 deletions
ALVARIZA-BILLAR_DESERT_KANY/
proje
t.js
→
ALVARIZA-BILLAR_DESERT_KANY/
scrip
t.js
+
22
−
4
View file @
9961e312
...
@@ -338,18 +338,27 @@ function house() {
...
@@ -338,18 +338,27 @@ function house() {
windowCentralMesh
.
updateMatrix
();
windowCentralMesh
.
updateMatrix
();
// creation toit pentu
// creation toit pentu
const
roofConeWidth
=
houseRoof1Width
;
const
roofConeWidth
=
houseRoof1Width
/
1.4
;
const
roofConeHeight
=
houseRoof1Height
;
const
roofConeHeight
=
outerCubeHeight
;
const
roofConeMesh
=
new
THREE
.
Mesh
(
new
THREE
.
ConeGeometry
(
roofConeWidth
,
roofConeHeight
,
4
),
new
THREE
.
MeshLambertMaterial
({
color
:
0xFF0000
})
);
roofConeMesh
.
position
.
set
(
dallePosition
.
x
,
dallePosition
.
y
+
(
dalleHeight
*
2
)
+
outerCubeHeight
+
(
houseRoof1Height
*
2
)
+
(
houseRoof2Height
*
2
)
-
100
,
// Posé sur le 1er toit
dallePosition
.
z
);
// Opération entre les différents éléments
// Opération entre les différents éléments
let
baseHesh
=
CSG
.
subtract
(
outerCubeMesh
,
innerCubeMesh
);
let
baseHesh
=
CSG
.
subtract
(
outerCubeMesh
,
innerCubeMesh
);
const
roofHesh1
=
CSG
.
subtract
(
houseRoof1
,
innerCubeMesh
);
const
roofHesh2
=
CSG
.
subtract
(
houseRoof2
,
innerCubeMesh
);
baseHesh
=
CSG
.
subtract
(
baseHesh
,
doorMesh
);
baseHesh
=
CSG
.
subtract
(
baseHesh
,
doorMesh
);
baseHesh
=
CSG
.
subtract
(
baseHesh
,
windowLeftMesh
);
baseHesh
=
CSG
.
subtract
(
baseHesh
,
windowLeftMesh
);
baseHesh
=
CSG
.
subtract
(
baseHesh
,
windowRightMesh
);
baseHesh
=
CSG
.
subtract
(
baseHesh
,
windowRightMesh
);
baseHesh
=
CSG
.
subtract
(
baseHesh
,
windowCentralMesh
);
baseHesh
=
CSG
.
subtract
(
baseHesh
,
windowCentralMesh
);
const
roofHesh1
=
CSG
.
subtract
(
houseRoof1
,
innerCubeMesh
);
const
roofHesh2
=
CSG
.
subtract
(
houseRoof2
,
innerCubeMesh
);
baseHesh
.
position
.
set
(
baseHesh
.
position
.
set
(
...
@@ -375,11 +384,18 @@ function house() {
...
@@ -375,11 +384,18 @@ function house() {
baseHesh
.
rotation
.
y
=
0.2225
;
baseHesh
.
rotation
.
y
=
0.2225
;
roofHesh1
.
rotation
.
y
=
0.2225
;
roofHesh1
.
rotation
.
y
=
0.2225
;
roofHesh2
.
rotation
.
y
=
0.2225
;
roofHesh2
.
rotation
.
y
=
0.2225
;
roofConeMesh
.
rotation
.
y
=
1.015
;
// Ajouter uniquement l'objet final à la scène
// Ajouter uniquement l'objet final à la scène
scene
.
add
(
baseHesh
);
scene
.
add
(
baseHesh
);
scene
.
add
(
roofHesh1
);
scene
.
add
(
roofHesh1
);
scene
.
add
(
roofHesh2
);
scene
.
add
(
roofHesh2
);
scene
.
add
(
roofConeMesh
)
// Creation de la lumiere à 360° au centre du toit pyramidal
const
pyramidLight
=
new
THREE
.
PointLight
(
0xFFCC06
,
1
,
1000
);
}
}
...
@@ -509,6 +525,8 @@ function init() {
...
@@ -509,6 +525,8 @@ function init() {
var
gui
=
new
dat
.
GUI
();
var
gui
=
new
dat
.
GUI
();
gui
.
add
(
window
,
'
carSpeed
'
,
10
,
200
).
step
(
5
).
name
(
'
Vitesse f1
'
);
gui
.
add
(
window
,
'
carSpeed
'
,
10
,
200
).
step
(
5
).
name
(
'
Vitesse f1
'
);
gui
.
add
(
window
,
'
carMoving
'
).
name
(
'
F1 mouvement
'
);
gui
.
add
(
window
,
'
carMoving
'
).
name
(
'
F1 mouvement
'
);
}
}
function
animate
()
{
function
animate
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment