updated to GLM...but only ortho matrix is OK.
This commit is contained in:
parent
6c6ee96be1
commit
91460aba5a
@ -1 +1 @@
|
||||
Subproject commit dd86bf63150b0f50dcc4a53b79df6cba63b04851
|
||||
Subproject commit e78ebebee1c373346ab6da0ee1a174090825f29a
|
2
CMCore
2
CMCore
@ -1 +1 @@
|
||||
Subproject commit e469041733b2446bad783c5176a1480622f78a0e
|
||||
Subproject commit 34b70f1b42c97602253a74d1769e60d340729682
|
@ -1 +1 @@
|
||||
Subproject commit c8141fd275ce2ac9f4087c446eb04ba1be3a93b3
|
||||
Subproject commit a7c3577cba0ec9cff2181cd506c1c33bc0423f4a
|
@ -11,7 +11,6 @@ set(ULRE_3RDPTY_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/3rdpty)
|
||||
include(vulkan)
|
||||
|
||||
include(math)
|
||||
#use_mgl(${ULRE_3RDPTY_ROOT_PATH}/MathGeoLib)
|
||||
use_glm(${ULRE_3RDPTY_ROOT_PATH}/glm)
|
||||
|
||||
include(use_cm_module)
|
||||
@ -38,7 +37,7 @@ SET(ULRE CMCore
|
||||
CMUtil
|
||||
ULRE.Util
|
||||
ULRE.SceneGraph
|
||||
MathGeoLib
|
||||
GLM
|
||||
${RENDER_LIBRARY}
|
||||
${Vulkan_LIBRARIES})
|
||||
|
||||
|
@ -71,16 +71,16 @@ private:
|
||||
{
|
||||
struct PlaneGridCreateInfo pgci;
|
||||
|
||||
pgci.coord[0].Set(-100,-100,0);
|
||||
pgci.coord[1].Set( 100,-100,0);
|
||||
pgci.coord[2].Set( 100, 100,0);
|
||||
pgci.coord[3].Set(-100, 100,0);
|
||||
pgci.coord[0]=Vector3f(-100,-100,0);
|
||||
pgci.coord[1]=Vector3f( 100,-100,0);
|
||||
pgci.coord[2]=Vector3f( 100, 100,0);
|
||||
pgci.coord[3]=Vector3f(-100, 100,0);
|
||||
|
||||
pgci.step.u=20;
|
||||
pgci.step.v=20;
|
||||
pgci.step.x=20;
|
||||
pgci.step.y=20;
|
||||
|
||||
pgci.side_step.u=10;
|
||||
pgci.side_step.v=10;
|
||||
pgci.side_step.x=10;
|
||||
pgci.side_step.y=10;
|
||||
|
||||
pgci.color.Set(0.5,0,0,1);
|
||||
pgci.side_color.Set(1,0,0,1);
|
||||
@ -96,12 +96,12 @@ private:
|
||||
pgci.side_color.Set(0,0,1,1);
|
||||
ro_plane_grid[2]=CreateRenderablePlaneGrid(db,material,&pgci);
|
||||
|
||||
camera->pos.Set(200,200,200,1.0);
|
||||
camera->pos=Vector4f(200,200,200,1.0);
|
||||
}
|
||||
|
||||
bool InitScene()
|
||||
{
|
||||
Add(ro_plane_grid[0],Matrix4f::identity);
|
||||
Add(ro_plane_grid[0],Matrix4f());
|
||||
Add(ro_plane_grid[1],rotate(HGL_RAD_90,0,1,0));
|
||||
Add(ro_plane_grid[2],rotate(HGL_RAD_90,1,0,0));
|
||||
|
||||
|
@ -71,12 +71,12 @@ private:
|
||||
|
||||
bool InitMaterial()
|
||||
{
|
||||
light.color.Set(1,1,1,1);
|
||||
light.position.Set(1000,1000,1000,1.0);
|
||||
light.color=Vector4f(1,1,1,1);
|
||||
light.position=Vector4f(1000,1000,1000,1.0);
|
||||
|
||||
phong.BaseColor.Set(1,1,1,1);
|
||||
phong.BaseColor=Vector4f(1,1,1,1);
|
||||
phong.ambient=0.5;
|
||||
phong.specular.Set(0.3,0.3,0.3,32);
|
||||
phong.specular=Vector4f(0.3,0.3,0.3,32);
|
||||
|
||||
{
|
||||
axis_material=db->CreateMaterial(OS_TEXT("res/material/VertexColor3D"));
|
||||
@ -162,7 +162,7 @@ private:
|
||||
{
|
||||
struct CubeCreateInfo cci;
|
||||
cci.has_color=true;
|
||||
cci.color.Set(1,1,1,1);
|
||||
cci.color=Vector4f(1,1,1,1);
|
||||
ro_cube=CreateRenderableCube(db,material,&cci);
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ protected:
|
||||
|
||||
void OnMousePressed (int,int,uint mk){mouse_key=mk;MousePressed(mk);}
|
||||
void OnMouseReleased(int,int,uint mk){mouse_key=0;MouseReleased(mk);}
|
||||
void OnMouseMove (int x,int y){mouse_pos.Set(x,y);MouseMove();}
|
||||
void OnMouseMove (int x,int y){mouse_pos.x=x;mouse_pos.y=y;MouseMove();}
|
||||
void OnMouseWheel (int v,int h,uint mk){MouseWheel(v,h,mk);}
|
||||
|
||||
protected:
|
||||
|
@ -62,9 +62,9 @@ namespace hgl
|
||||
struct PlaneGridCreateInfo
|
||||
{
|
||||
Vector3f coord[4];
|
||||
vec2<uint> step;
|
||||
Vector2u step;
|
||||
|
||||
vec2<uint> side_step; //到边界的步数
|
||||
Vector2u side_step; //到边界的步数
|
||||
|
||||
Color4f color; //一般线条颜色
|
||||
Color4f side_color; //边界线条颜色
|
||||
|
2
res
2
res
@ -1 +1 @@
|
||||
Subproject commit 9385c782cc857a87f579d2a022d18918e3526147
|
||||
Subproject commit 8dbe22e45adc11317f5d38be04b359655f4dffac
|
@ -63,7 +63,7 @@ namespace hgl
|
||||
|
||||
AutoDelete<VB2f> vertex=rc.CreateVADA<VB2f>(VAN::Position);
|
||||
|
||||
vec2<float> *coord=new vec2<float>[rci->round_per];
|
||||
Vector2f *coord=new Vector2f[rci->round_per];
|
||||
|
||||
float l=rci->scope.GetLeft(),
|
||||
r=rci->scope.GetRight(),
|
||||
@ -164,21 +164,21 @@ namespace hgl
|
||||
{
|
||||
RenderableCreater rc(db,mtl);
|
||||
|
||||
if(!rc.Init(((pgci->step.u+1)+(pgci->step.v+1))*2))
|
||||
if(!rc.Init(((pgci->step.x+1)+(pgci->step.y+1))*2))
|
||||
return(nullptr);
|
||||
|
||||
AutoDelete<VB3f> vertex=rc.CreateVADA<VB3f>(VAN::Position);
|
||||
for(uint row=0;row<=pgci->step.u;row++)
|
||||
for(uint row=0;row<=pgci->step.x;row++)
|
||||
{
|
||||
float pos=float(row)/float(pgci->step.u);
|
||||
float pos=float(row)/float(pgci->step.x);
|
||||
|
||||
vertex->WriteLine( to(pgci->coord[0],pgci->coord[1],pos),
|
||||
to(pgci->coord[3],pgci->coord[2],pos));
|
||||
}
|
||||
|
||||
for(uint col=0;col<=pgci->step.v;col++)
|
||||
for(uint col=0;col<=pgci->step.y;col++)
|
||||
{
|
||||
float pos=float(col)/float(pgci->step.v);
|
||||
float pos=float(col)/float(pgci->step.y);
|
||||
|
||||
vertex->WriteLine(to(pgci->coord[1],pgci->coord[2],pos),
|
||||
to(pgci->coord[0],pgci->coord[3],pos));
|
||||
@ -187,17 +187,17 @@ namespace hgl
|
||||
AutoDelete<VB4f> color=rc.CreateVADA<VB4f>(VAN::Color);
|
||||
if(color)
|
||||
{
|
||||
for(uint row=0;row<=pgci->step.u;row++)
|
||||
for(uint row=0;row<=pgci->step.x;row++)
|
||||
{
|
||||
if((row%pgci->side_step.u)==0)
|
||||
if((row%pgci->side_step.x)==0)
|
||||
color->Fill(pgci->side_color,2);
|
||||
else
|
||||
color->Fill(pgci->color,2);
|
||||
}
|
||||
|
||||
for(uint col=0;col<=pgci->step.v;col++)
|
||||
for(uint col=0;col<=pgci->step.y;col++)
|
||||
{
|
||||
if((col%pgci->side_step.v)==0)
|
||||
if((col%pgci->side_step.y)==0)
|
||||
color->Fill(pgci->side_color,2);
|
||||
else
|
||||
color->Fill(pgci->color,2);
|
||||
|
@ -5,18 +5,18 @@ namespace hgl
|
||||
{
|
||||
SceneOrient::SceneOrient()
|
||||
{
|
||||
LocalMatrix =Matrix4f::identity;
|
||||
LocalToWorldMatrix =Matrix4f::identity;
|
||||
InverseLocalMatrix =Matrix4f::identity;
|
||||
InverseLocalToWorldMatrix =Matrix4f::identity;
|
||||
//LocalMatrix =Matrix4f::identity;
|
||||
//LocalToWorldMatrix =Matrix4f::identity;
|
||||
//InverseLocalMatrix =Matrix4f::identity;
|
||||
//InverseLocalToWorldMatrix =Matrix4f::identity;
|
||||
}
|
||||
|
||||
SceneOrient::SceneOrient(const Matrix4f &mat)
|
||||
{
|
||||
SetLocalMatrix(mat);
|
||||
|
||||
LocalToWorldMatrix =Matrix4f::identity;
|
||||
InverseLocalToWorldMatrix =Matrix4f::identity;
|
||||
//LocalToWorldMatrix =Matrix4f::identity;
|
||||
//InverseLocalToWorldMatrix =Matrix4f::identity;
|
||||
}
|
||||
|
||||
Matrix4f &SceneOrient::SetLocalMatrix(const Matrix4f &m)
|
||||
|
Loading…
x
Reference in New Issue
Block a user