mirror of https://github.com/buggins/dlangui.git
#183 Scene3d: fix OBJ import
This commit is contained in:
parent
ec25eb2104
commit
35ee4fbb99
|
@ -121,8 +121,8 @@ class UiWidget : VerticalLayout, CellVisitor {
|
|||
dirLightNode.translateX(2);
|
||||
dirLightNode.translateY(3);
|
||||
dirLightNode.translateZ(3);
|
||||
dirLightNode.light = Light.createPoint(vec3(1, 0.5, 0.5), 15); //Light.createDirectional(vec3(1, 0.5, 0.5));
|
||||
//dirLightNode.light = Light.createDirectional(vec3(11, 10.5, 10.5));
|
||||
//dirLightNode.light = Light.createPoint(vec3(1, 0.5, 0.5), 15); //Light.createDirectional(vec3(1, 0.5, 0.5));
|
||||
dirLightNode.light = Light.createDirectional(vec3(1, 0.5, 0.8));
|
||||
dirLightNode.light.enabled = true;
|
||||
_scene.addChild(dirLightNode);
|
||||
|
||||
|
@ -364,8 +364,8 @@ class UiWidget : VerticalLayout, CellVisitor {
|
|||
//projectionViewModelMatrix.setIdentity();
|
||||
//Log.d("matrix uniform: ", projectionViewModelMatrix.m);
|
||||
|
||||
checkgl!glEnable(GL_CULL_FACE);
|
||||
//checkgl!glDisable(GL_CULL_FACE);
|
||||
//checkgl!glEnable(GL_CULL_FACE);
|
||||
checkgl!glDisable(GL_CULL_FACE);
|
||||
checkgl!glEnable(GL_DEPTH_TEST);
|
||||
checkgl!glCullFace(GL_BACK);
|
||||
|
||||
|
|
|
@ -21,13 +21,19 @@ struct ObjModelImport {
|
|||
|
||||
protected float[] parseFloatList(Token[] tokens, int maxItems = 3, float padding = 0) {
|
||||
int i = 0;
|
||||
int sgn = 1;
|
||||
foreach(t; tokens) {
|
||||
if (i >= maxItems)
|
||||
break;
|
||||
if (t.type == TokenType.floating)
|
||||
_buf[i++] = cast(float)t.floatvalue;
|
||||
else if (t.type == TokenType.integer)
|
||||
_buf[i++] = cast(float)t.intvalue;
|
||||
if (t.type == TokenType.floating) {
|
||||
_buf[i++] = cast(float)(t.floatvalue * sgn);
|
||||
sgn = 1;
|
||||
} else if (t.type == TokenType.integer) {
|
||||
_buf[i++] = cast(float)(t.intvalue * sgn);
|
||||
sgn = 1;
|
||||
} else if (t.type == TokenType.minus) {
|
||||
sgn = -1;
|
||||
}
|
||||
}
|
||||
while(i < maxItems)
|
||||
_buf[i++] = padding;
|
||||
|
|
Loading…
Reference in New Issue