improved Gizmo3DMove.cpp
This commit is contained in:
parent
b16341c0f9
commit
ba2d479f05
2
CMCore
2
CMCore
@ -1 +1 @@
|
||||
Subproject commit b5c66fe2cd440d15db54219404a2b4b44ce1018f
|
||||
Subproject commit 1141f37cc4ae98441e0e75809a8757851c836408
|
@ -1 +1 @@
|
||||
Subproject commit 95ebf98ddb0c1f48859e84830e2bcd44965f04f5
|
||||
Subproject commit 5a12a0cac7e4a5b935bd7112f3ec70179c5216b4
|
@ -14,6 +14,6 @@ CreateProject(01_PlaneGrid3D PlaneGrid3D.cpp)
|
||||
CreateProject(02_RayPicking RayPicking.cpp)
|
||||
CreateProject(03_MetricCellsGrid MetricCellsGrid.cpp)
|
||||
|
||||
CreateProject(04_Gizmo3DMove Gizmo3DMove.cpp)
|
||||
CreateProject(04_Gizmo3DMove Gizmo3DMove.cpp Gizmo.h Gizmo.cpp)
|
||||
|
||||
#CreateProject(03_BlenderAxis BlenderAxis.cpp)
|
||||
|
0
example/Gizmo/Gizmo.cpp
Normal file
0
example/Gizmo/Gizmo.cpp
Normal file
16
example/Gizmo/Gizmo.h
Normal file
16
example/Gizmo/Gizmo.h
Normal file
@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include<hgl/graph/VK.h>
|
||||
|
||||
VK_NAMESPACE_BEGIN
|
||||
|
||||
class Gizmo
|
||||
{
|
||||
Material * material;
|
||||
MaterialInstance * mi;
|
||||
Pipeline * pipeline;
|
||||
Primitive * primitive;
|
||||
|
||||
};//class Gizmo
|
||||
|
||||
VK_NAMESPACE_END
|
@ -6,7 +6,6 @@
|
||||
#include<hgl/graph/VKRenderResource.h>
|
||||
#include<hgl/graph/RenderList.h>
|
||||
#include<hgl/graph/Camera.h>
|
||||
#include<hgl/graph/Ray.h>
|
||||
#include<hgl/graph/VKVertexAttribBuffer.h>
|
||||
#include<hgl/graph/mtl/Material3DCreateConfig.h>
|
||||
|
||||
@ -34,10 +33,6 @@ private:
|
||||
Pipeline * pipeline_vtx_color =nullptr;
|
||||
Primitive * ro_line =nullptr;
|
||||
|
||||
VBO * vbo_pos =nullptr;
|
||||
|
||||
Ray ray;
|
||||
|
||||
private:
|
||||
|
||||
bool InitMaterialAndPipeline()
|
||||
@ -169,9 +164,10 @@ private:
|
||||
}
|
||||
|
||||
{
|
||||
constexpr const uint AXIS_MAX_LINES =7;
|
||||
constexpr const uint AXIS_MAX_LINES =7;
|
||||
constexpr const uint AXIS_MAX_VERTICES =AXIS_MAX_LINES*2*3;
|
||||
|
||||
ro_line=db->CreatePrimitive("Line",AXIS_MAX_LINES*2*3);
|
||||
ro_line=db->CreatePrimitive("Line",AXIS_MAX_VERTICES);
|
||||
if(!ro_line)return(false);
|
||||
|
||||
Vector3f position_data[3][AXIS_MAX_LINES*2];
|
||||
@ -186,8 +182,8 @@ private:
|
||||
for(Color4f &c:color_data[1])c=Color4f(0,1,0,1);
|
||||
for(Color4f &c:color_data[2])c=Color4f(0,0,1,1);
|
||||
|
||||
if(!ro_line->Set(VAN::Position, vbo_pos= db->CreateVBO(VF_V3F,AXIS_MAX_LINES*2*3,position_data)))return(false);
|
||||
if(!ro_line->Set(VAN::Color, db->CreateVBO(VF_V4F,AXIS_MAX_LINES*2*3,color_data )))return(false);
|
||||
if(!ro_line->Set(VAN::Position, db->CreateVBO(VF_V3F,AXIS_MAX_VERTICES,position_data)))return(false);
|
||||
if(!ro_line->Set(VAN::Color, db->CreateVBO(VF_V4F,AXIS_MAX_VERTICES,color_data )))return(false);
|
||||
}
|
||||
|
||||
return(true);
|
||||
@ -195,7 +191,7 @@ private:
|
||||
|
||||
bool InitScene()
|
||||
{
|
||||
//Add(ro_plane_grid,mi_plane_grid,pipeline_vtx_lum);
|
||||
Add(ro_plane_grid,mi_plane_grid,pipeline_vtx_lum);
|
||||
Add(ro_line,mi_line,pipeline_vtx_color);
|
||||
|
||||
camera->pos=Vector3f(32,32,32);
|
||||
|
Loading…
x
Reference in New Issue
Block a user