326

(4 replies, posted in Engine)

Hi ksubox,

did you try using scons to compile ?
info here : http://wiki.maratis3d.org/index.php?tit … umentation

327

(56 replies, posted in Editor)

Yes you are right it's "onChar"
(EDITED on top)

328

(56 replies, posted in Editor)

unicode is important, or you'll be limited to type MAJ only,
you are using MGui.2 with the current branch of Maratis as a plugin yes ?
(current branch is ASCII, when the new experimental branch is unicode)

Anyway, some development is needed.

The only thing you can do right now is to access ASCII characters and special keys one by one :

char name[2] = {0, 0};

// A to Z
for(int i=65; i<=90; i++)
{
    name[0] = i;
    if(input->onKeyDown(name))
        rootWindow->onChar(i);
}

// 0 to 9
for(int i=48; i<=57; i++)
{
    name[0] = i;
    if(input->onKeyDown(name))
        rootWindow->onChar(i);
}

// special keys
if(input->onKeyDown("UP"))
    rootWindow->onKeyDown(MKEY_UP);
if(input->onKeyDown("DOWN"))
    rootWindow->onKeyDown(MKEY_DOWN);
if(input->onKeyDown("LEFT"))
    rootWindow->onKeyDown(MKEY_LEFT);
if(input->onKeyDown("RIGHT"))
    rootWindow->onKeyDown(MKEY_RIGHT);

if(input->onKeyDown("BACKSPACE"))
    rootWindow->onKeyDown(MKEY_BACKSPACE);
if(input->onKeyDown("ENTER"))
    rootWindow->onKeyDown(MKEY_RETURN);
if(input->onKeyDown("SPACE"))
    rootWindow->onKeyDown(MKEY_SPACE);

// and do the same with onKeyDown

not pretty and not the best, but we'll add a better automatic way at some point.

329

(56 replies, posted in Editor)

yes right now a better mechanism is needed to feed the character events,
the trunk version of Maratis doesn't really support unicode like the new experimental branch.

I'll think about something, maybe committing the unicode fix in the trunk.

330

(10 replies, posted in General)

nice smile
for the surface the yellow part normal map should be perfectly flat
and contrast with a bumpy rusty part.

You could also use one the "standard shader with additional envmap" custom shader there :
http://www.maratis3d.org/?p=548
so you can add a fake slight reflexion.

You can animate the texture UV offset.
Look at this link : http://forum.maratis3d.com/viewtopic.php?id=98

332

(15 replies, posted in General)

yes, the publishing need some more work,
some of it is actually not very complicated to implement.

333

(5 replies, posted in General)

For mac it's the same system,
you just have to go inside the MaratisPlayer.app packet :

create a bash with something like :
MaratisPlayer.app/Contents/MacOS/MaratisPLayer "" 1024 768 1

334

(15 replies, posted in General)

you can also recompile Maratis Player : https://code.google.com/p/maratis/sourc … r/main.cpp
the title is set there :

window->create("Maratis"...

335

(12 replies, posted in General)

yes sorry, you are right, because MGame::draw(); call a clear.

336

(12 replies, posted in General)

actually I taught about something even simpler :

void MyGame::draw(void)
{
    // here make all x-ray objects invisible
    ...

    // draw the scene without x-ray objects
    MGame::draw();

    // clear depth buffer
    render->clear(M_BUFFER_DEPTH);

    // here make all x-ray objects visible, and others invisible
    ...

    // draw x-ray objects only
    scene->draw(camera); // [EDIT]
}

337

(12 replies, posted in General)

the first method is not necessarily slow as you can either deactivate the x-ray objects in the main scene when they are in x-ray, or have the x-ray objects only in the secondary scene from the beginning (if they are always seen in x-ray).

Other solution is to add an option in MMaterial to ignore depth-test so the object won't be affected by the z-buffer,
but your material should use an additive blending mode to avoid self intersection issues (additive blending can be render in any order).

338

(12 replies, posted in General)

x-ray, ok, so what I say previously is not totally related.

there is multiple ways to do it,

I think the simpler way would be to create a second scene where you put only the objects you want to draw in xray.
Use a clone of the main scene camera to syncronise the perspective and render this scene on top of the main scene as a camera-layer : http://wiki.maratis3d.org/index.php?tit … ameraLayer

Another way would be to do that by hand in MGame::draw,
after the scene draw, you disable the depth test with MRenderingContext and you render the x-ray objects after.

339

(12 replies, posted in General)

do you mean the general painter's algorithm ? (was used for real time software 3d before the z buffer technique)

or do you just want to do a special effect ?

in Maratis the rendering order is managed by MRenderer (here fixedRenderer or standardRenderer),
in the standardRenderer it happen globally like that :

- get the list of objects visible in the camera view
- render all non-transparent sub-meshs from near to far in depth-test only (early Z test) and build occlusion culling
- render occlusion-culled non-transparent sub-meshs in random order
- render transparent sub-meshs in far to near order

It's a bit different in the iOS renderer for example (no early z test because iphone and iPad 3d card uses tiled rendering).

To sort objects you can use MCore's "sortFloatList(int indexList[], float floatList[], int start, int end)"

But all depends on what you want to achieve.

Topic closed,
do you really think I have time for that ? sad

Good animation tutorial, it's the basics of animation any 3d animator need to master,
you can transmit a lot of the character feeling and energy with the body, thanks, keep going.

342

(13 replies, posted in General)

Another thing that happens to me is that threads are automatically set to "read" even when I've not actually read them

I experienced that too,
when I get some time I'll see if I can update PunBB.

343

(2 replies, posted in Gossip)

it's interesting, I don't know how far it can go but the video is impressive.

for the ones interested, the research paper is here : http://cg.cs.tsinghua.edu.cn/papers/SIG … 3sweep.pdf

344

(8 replies, posted in General)

smile

345

(8 replies, posted in General)

so maybe your entity bounding box is not up to date :
*entity->getBoundingBox() = *mesh->getBoundingBox();

346

(8 replies, posted in General)

try to use :

// for each sub mesh you modify :
subMesh->getBoundingBox()->initFromPoints(subMesh->getVertices(), subMesh->getVerticesSize());

// then update the mesh :
mesh->updateBoundingBox();

347

(9 replies, posted in Engine)

Hi,

sorry for the late reply, I was working in another town for a week,
it will be valuable to add a simple to use post-processing system to the trunk.

At first it could follow the logic of the camera layer and add two functions to activate/deactivate a post-process shader in lua.
Later we could add something in the editor, but probably only after we move the editor to MGui-v2 (from the experimental branch).

1 : add an "MFXRef * m_FXRef;" to MOCamera to handle the post-processing shaders
there is already "MTextureRef * m_renderColorTexture;" and "MTextureRef * m_renderDepthTexture;" to handle the render to texture.

2 : add the effect rendering to the default MGame::draw

3 : add two lua functions to enable and disable a camera effect. For exemple :

Camera = getObject("Camera")
enableCameraPostProcess(Camera, "shaders/myPostShader.frag")
disableCameraPostProcess(Camera)

4 : in a second time, we also need to add custom variables to the camera to send uniform variables to the shader (to control blur size, focus etc). I'll think about something generic that can create dynamic MVariable.

348

(21 replies, posted in General)

yes the angle is in degree,
the base of your code is ok, you do a cross-product to find the rotation axis
and a dot product to find the angle.

by the way there is some macro for degree/radians conversion in MCore :
DEG_TO_RAD and RAD_TO_DEG (ex : degree = radian*RAD_TO_DEG;)

after, I'm not sure to understand what you want to do with an offset
so it's possible that you have a problem on this part.

349

(21 replies, posted in General)

I think AxisYPoint or P and Q might be wrong,
they all need to be in the same coordinate, meaning global or local.

so, or you make AxisYPoint global, or you make Q and P local.

you can look at the code of the look-at behavior : https://maratis.googlecode.com/svn/trun … LookAt.cpp

350

(11 replies, posted in Gossip)

saw that ? : http://www.youtube.com/watch?v=yAodpXG2kQE