Added shelf model: todo: hot model importing
This commit is contained in:
parent
5357de69a7
commit
d3837ec326
@ -1,28 +0,0 @@
|
|||||||
Entities:
|
|
||||||
- ID: 0
|
|
||||||
Name: Light
|
|
||||||
Components:
|
|
||||||
Light:
|
|
||||||
Type: 2
|
|
||||||
Intensity: 9.30000019
|
|
||||||
Color: [1, 1, 1]
|
|
||||||
Constant: 1
|
|
||||||
Linear: 0.0900000036
|
|
||||||
Quadratic: 0.0320000015
|
|
||||||
cutOff: 0
|
|
||||||
outerCutOff: 39.7900009
|
|
||||||
Direction: [-0.200000003, -1, -0.300000012]
|
|
||||||
Transform:
|
|
||||||
Position: [-1.70000005, -0.200000003, -0.100000001]
|
|
||||||
Rotation: [1.5, 2.70000005, -17.5]
|
|
||||||
Scale: [1, 1, 1]
|
|
||||||
- ID: 1
|
|
||||||
Name: Cube
|
|
||||||
Components:
|
|
||||||
Render:
|
|
||||||
MeshName: WhiteCube
|
|
||||||
Color: [1, 1, 1]
|
|
||||||
Transform:
|
|
||||||
Position: [-1.21370173, 1.20000005, 0]
|
|
||||||
Rotation: [1.34287302e-05, -41.9440002, 1.62548586e-05]
|
|
||||||
Scale: [1, 1, 1]
|
|
12
assets/bookshelf.mtl
Normal file
12
assets/bookshelf.mtl
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# Blender 4.3.0 MTL File: 'bookshelf.blend'
|
||||||
|
# www.blender.org
|
||||||
|
|
||||||
|
newmtl Material
|
||||||
|
Ns 250.000000
|
||||||
|
Ka 1.000000 1.000000 1.000000
|
||||||
|
Kd 0.800000 0.800000 0.800000
|
||||||
|
Ks 0.500000 0.500000 0.500000
|
||||||
|
Ke 0.000000 0.000000 0.000000
|
||||||
|
Ni 1.450000
|
||||||
|
d 1.000000
|
||||||
|
illum 2
|
14301
assets/bookshelf.obj
Normal file
14301
assets/bookshelf.obj
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,18 +0,0 @@
|
|||||||
Entities:
|
|
||||||
- ID: 0
|
|
||||||
Name: Entity 0
|
|
||||||
Components:
|
|
||||||
Light:
|
|
||||||
Type: 0
|
|
||||||
Intensity: 1
|
|
||||||
Color: [1, 1, 1]
|
|
||||||
Constant: 1
|
|
||||||
Linear: 0.0900000036
|
|
||||||
Quadratic: 0.0320000015
|
|
||||||
cutOff: 12.5
|
|
||||||
outerCutOff: 17.5
|
|
||||||
Direction: [-0.200000003, -1, -0.300000012]
|
|
||||||
Transform:
|
|
||||||
Position: [0, 0, 0]
|
|
||||||
Rotation: [0, 0, 0]
|
|
||||||
Scale: [1, 1, 1]
|
|
@ -1,8 +0,0 @@
|
|||||||
Entities:
|
|
||||||
- ID: 0
|
|
||||||
Name: Entity 0
|
|
||||||
Components:
|
|
||||||
Transform:
|
|
||||||
Position: [0, 0, 0]
|
|
||||||
Rotation: [0, 0, 0]
|
|
||||||
Scale: [1, 1, 1]
|
|
14301
bookshelf.obj
Normal file
14301
bookshelf.obj
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
BIN
build/main.o
BIN
build/main.o
Binary file not shown.
14
imgui.ini
14
imgui.ini
@ -16,9 +16,9 @@ DockId=0x00000005,0
|
|||||||
|
|
||||||
[Window][Game View]
|
[Window][Game View]
|
||||||
Pos=312,28
|
Pos=312,28
|
||||||
Size=607,779
|
Size=1213,779
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
DockId=0x0000000D,0
|
DockId=0x00000009,0
|
||||||
|
|
||||||
[Window][Asset Panel]
|
[Window][Asset Panel]
|
||||||
Pos=8,607
|
Pos=8,607
|
||||||
@ -51,10 +51,10 @@ Collapsed=0
|
|||||||
DockId=0x0000000C,0
|
DockId=0x0000000C,0
|
||||||
|
|
||||||
[Window][Camera Preview]
|
[Window][Camera Preview]
|
||||||
Pos=921,28
|
Pos=312,28
|
||||||
Size=604,779
|
Size=1213,779
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
DockId=0x0000000E,0
|
DockId=0x00000009,1
|
||||||
|
|
||||||
[Docking][Data]
|
[Docking][Data]
|
||||||
DockSpace ID=0xC746EC7D Window=0x9DF47A72 Pos=8,28 Size=1904,1161 Split=X Selected=0x642CEEBB
|
DockSpace ID=0xC746EC7D Window=0x9DF47A72 Pos=8,28 Size=1904,1161 Split=X Selected=0x642CEEBB
|
||||||
@ -65,9 +65,7 @@ DockSpace ID=0xC746EC7D Window=0x9DF47A72 Pos=8,28 Size=1904,1161 Spli
|
|||||||
DockNode ID=0x00000002 Parent=0x00000003 SizeRef=1213,1161 Split=X
|
DockNode ID=0x00000002 Parent=0x00000003 SizeRef=1213,1161 Split=X
|
||||||
DockNode ID=0x00000005 Parent=0x00000002 SizeRef=197,1161 Selected=0x4E0EE8E4
|
DockNode ID=0x00000005 Parent=0x00000002 SizeRef=197,1161 Selected=0x4E0EE8E4
|
||||||
DockNode ID=0x00000006 Parent=0x00000002 SizeRef=1035,1161 Split=Y Selected=0x642CEEBB
|
DockNode ID=0x00000006 Parent=0x00000002 SizeRef=1035,1161 Split=Y Selected=0x642CEEBB
|
||||||
DockNode ID=0x00000009 Parent=0x00000006 SizeRef=1266,779 Split=X Selected=0x642CEEBB
|
DockNode ID=0x00000009 Parent=0x00000006 SizeRef=1266,779 CentralNode=1 Selected=0x642CEEBB
|
||||||
DockNode ID=0x0000000D Parent=0x00000009 SizeRef=607,779 CentralNode=1 Selected=0x642CEEBB
|
|
||||||
DockNode ID=0x0000000E Parent=0x00000009 SizeRef=604,779 Selected=0x111AC246
|
|
||||||
DockNode ID=0x0000000A Parent=0x00000006 SizeRef=1266,380 Selected=0xE534E588
|
DockNode ID=0x0000000A Parent=0x00000006 SizeRef=1266,380 Selected=0xE534E588
|
||||||
DockNode ID=0x00000004 Parent=0xC746EC7D SizeRef=385,1161 Split=Y Selected=0xE7039252
|
DockNode ID=0x00000004 Parent=0xC746EC7D SizeRef=385,1161 Split=Y Selected=0xE7039252
|
||||||
DockNode ID=0x0000000B Parent=0x00000004 SizeRef=385,779 Selected=0xE7039252
|
DockNode ID=0x0000000B Parent=0x00000004 SizeRef=385,779 Selected=0xE7039252
|
||||||
|
71
scene.polys
71
scene.polys
@ -1,85 +1,18 @@
|
|||||||
Entities:
|
Entities:
|
||||||
- ID: 0
|
- ID: 0
|
||||||
Name: Light
|
Name: Entity 0
|
||||||
Components:
|
|
||||||
Light:
|
|
||||||
Type: 0
|
|
||||||
Intensity: 1
|
|
||||||
Color: [0, 1, 0]
|
|
||||||
Constant: 1
|
|
||||||
Linear: 0.0900000036
|
|
||||||
Quadratic: 0.0320000015
|
|
||||||
cutOff: 0
|
|
||||||
outerCutOff: 39.7900009
|
|
||||||
Direction: [-0.200000003, -1, -0.300000012]
|
|
||||||
Transform:
|
|
||||||
Position: [-1.6726234, -0.228918433, 0.638042808]
|
|
||||||
Rotation: [1.5, 2.70000005, 342.5]
|
|
||||||
Scale: [1, 1, 1]
|
|
||||||
- ID: 1
|
|
||||||
Name: Cube
|
|
||||||
Components:
|
|
||||||
Render:
|
|
||||||
MeshName: model
|
|
||||||
Color: [1, 1, 1]
|
|
||||||
Transform:
|
|
||||||
Position: [0, 0, 0]
|
|
||||||
Rotation: [0, -166.600006, 0]
|
|
||||||
Scale: [0.100000001, 0.100000001, 0.100000001]
|
|
||||||
- ID: 2
|
|
||||||
Name: Environment
|
|
||||||
Components:
|
Components:
|
||||||
Transform:
|
Transform:
|
||||||
Position: [0, 0, 0]
|
Position: [0, 0, 0]
|
||||||
Rotation: [0, 0, 0]
|
Rotation: [0, 0, 0]
|
||||||
Scale: [18.7000008, 7.4000001, 10]
|
|
||||||
Render:
|
|
||||||
MeshName: WhiteCube
|
|
||||||
Color: [1, 1, 1]
|
|
||||||
- ID: 3
|
|
||||||
Name: LightBlue
|
|
||||||
Components:
|
|
||||||
Transform:
|
|
||||||
Position: [0, 1.8090117, 3.07234383]
|
|
||||||
Rotation: [0, 0, 0]
|
|
||||||
Scale: [1, 1, 1]
|
|
||||||
Light:
|
|
||||||
Type: 0
|
|
||||||
Intensity: 2
|
|
||||||
Color: [0, 0, 1]
|
|
||||||
Constant: 1
|
|
||||||
Linear: 0
|
|
||||||
Quadratic: 0.200000003
|
|
||||||
cutOff: 12.5
|
|
||||||
outerCutOff: 17.5
|
|
||||||
Direction: [-0.200000003, -1, -0.300000012]
|
|
||||||
- ID: 4
|
|
||||||
Name: LightRed
|
|
||||||
Components:
|
|
||||||
Transform:
|
|
||||||
Position: [-2.94120026, 1.60229158, -1.5770874]
|
|
||||||
Rotation: [0, 0, 0]
|
|
||||||
Scale: [1, 1, 1]
|
Scale: [1, 1, 1]
|
||||||
Light:
|
Light:
|
||||||
Type: 0
|
Type: 0
|
||||||
Intensity: 1
|
Intensity: 1
|
||||||
Color: [1, 0, 0]
|
Color: [1, 1, 1]
|
||||||
Constant: 1
|
Constant: 1
|
||||||
Linear: 0.0900000036
|
Linear: 0.0900000036
|
||||||
Quadratic: 0.0320000015
|
Quadratic: 0.0320000015
|
||||||
cutOff: 12.5
|
cutOff: 12.5
|
||||||
outerCutOff: 17.5
|
outerCutOff: 17.5
|
||||||
Direction: [-0.200000003, -1, -0.300000012]
|
Direction: [-0.200000003, -1, -0.300000012]
|
||||||
- ID: 5
|
|
||||||
Name: Camera
|
|
||||||
Components:
|
|
||||||
Transform:
|
|
||||||
Position: [0, 0, 0]
|
|
||||||
Rotation: [0, 26.2000008, 0]
|
|
||||||
Scale: [0.100000001, 0.100000001, -0.100000001]
|
|
||||||
Camera:
|
|
||||||
Zoom: 10
|
|
||||||
FOV: 45
|
|
||||||
Orthographic: false
|
|
||||||
NearPlane: 0.100000001
|
|
||||||
FarPlane: 1000
|
|
14
src/main.cpp
14
src/main.cpp
@ -111,6 +111,8 @@ bool GameRunning = false;
|
|||||||
|
|
||||||
Model ImportedModel;
|
Model ImportedModel;
|
||||||
|
|
||||||
|
Model ImportedModel_shelf;
|
||||||
|
|
||||||
// Function prototypes
|
// Function prototypes
|
||||||
void RenderCube(glm::mat4 model, glm::mat4 view, glm::mat4 projection, glm::vec3 viewPos, glm::vec3 lightPos);
|
void RenderCube(glm::mat4 model, glm::mat4 view, glm::mat4 projection, glm::vec3 viewPos, glm::vec3 lightPos);
|
||||||
|
|
||||||
@ -496,6 +498,14 @@ int main()
|
|||||||
|
|
||||||
ImportedModel.textureID = ImportedModel.loadTexture("./assets/texture.png");
|
ImportedModel.textureID = ImportedModel.loadTexture("./assets/texture.png");
|
||||||
|
|
||||||
|
if (!ImportedModel_shelf.loadFromOBJ("./bookshelf.obj"))
|
||||||
|
{
|
||||||
|
std::cerr << "Failed to load model!" << std::endl;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//ImportedModel.textureID = ImportedModel.loadTexture("./assets/texture.png");
|
||||||
|
|
||||||
// Cube vertex data
|
// Cube vertex data
|
||||||
// Cube vertex data (positions and normals)
|
// Cube vertex data (positions and normals)
|
||||||
GLfloat vertices[] = {
|
GLfloat vertices[] = {
|
||||||
@ -1798,6 +1808,10 @@ void ShowGameView(std::vector<std::shared_ptr<Entity>> &entities)
|
|||||||
{
|
{
|
||||||
ImportedModel.render(transform, render, cubeShader);
|
ImportedModel.render(transform, render, cubeShader);
|
||||||
}
|
}
|
||||||
|
else if (render->meshName == "shelf")
|
||||||
|
{
|
||||||
|
ImportedModel_shelf.render(transform, render, cubeShader);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Draw cube
|
// Draw cube
|
||||||
|
5
test/test.md
Normal file
5
test/test.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# Physics 3d Test
|
||||||
|
|
||||||
|
make a C++ physics test
|
||||||
|
|
||||||
|
[https://www.reactphysics3d.com/documentation/index.html](https://www.reactphysics3d.com/documentation/index.html)
|
Loading…
Reference in New Issue
Block a user