151

(4 replies, posted in Editor)

You need to create texture coordinates by unwrapping your mesh in Blender :
http://wiki.blender.org/index.php/Doc:2 … Unwrapping

152

(4 replies, posted in Editor)

- first possibility :

Check the texture path: "..\maps\worldPlateGrass.jpg"

The path is relative to the mesh file, so your files should be arranged like this :
project/
    maps/
        worldPlateGrass.jpg
    meshs/
        yourMesh.mesh

If you moved the mesh in a sub-directory you need to edit the path in the mesh file, same if you moved the texture.


- second possibility :

There is no texture coordinates in your mesh file,
so be sure you have uv coordinates in blender (unwrap).

And don't forget to select UV in the texture coordinates :

http://www.maratis3d.com/wp-content/uploads/2011/01/10.jpg

read this documentation carefully : http://www.maratis3d.org/?p=277

153

(3 replies, posted in General)

Hi,
are you using the version downloaded from Maratis website or did you compile it yourself ?

The version from the website is 32bit, to run it on linux 64 you need to install the package "ia32-libs"
http://www.markusbe.com/2009/09/about-r … libraries/

154

(7 replies, posted in Showcase)

Hey, don't you want to take part of a game jam ?

The next Ludum Dare starts 22 August : http://www.ludumdare.com/compo/rules/

155

(13 replies, posted in Tutorials/Examples)

to convert % in position, just use the start and end positions :

- convert your % to a number between 0 and 1 : factor = percent*0.01
- then : pos = start_pos + (end_pos - start_pos)*factor

156

(13 replies, posted in Tutorials/Examples)

that's awesome !

The Radius collision detection mproj is not connected to the correct level by default,
I just loaded the good level and it worked.

But I didn't managed to make the Spawn multiple clones level working.

setAnimationSpeed works with all animation, armature, materials and textures.
It's used in the particles example to control particles fade speed : http://www.maratis3d.org/download/SpecialEffects.zip

But for a fade to black effect, for maximum control you should create a non-looping animation
and use "setCurrentFrame" so you can have the exact fade you want.

- do a fading animation from frame 0 to frame 100, and set loops to 0 instead of -1 in Blender (see screenshot)
- in lua use "setCurrentFrame(object, percent)"

http://www.maratis3d.com/wp-content/uploads/2011/01/12.jpg

Hi, you should look at this tutorial : http://www.maratis3d.org/?p=277

You can animate the "Alpha" value :
http://www.maratis3d.com/wp-content/uploads/2011/01/04.jpg

- move your mouse over the "Alpha" value and press "i" on your keyboard to create an animation key.
- move the current frame in the timeline, change the alpha value and press "i" again

159

(32 replies, posted in Plugins)

I can see the video now, promising !!

160

(32 replies, posted in Plugins)

seems nice,

about the script,
it will be faster if you call a function from the current scene script so you are not loading/compiling the script each time :

replace m_scriptName with m_functionName and use "callFunction" instead :

if(input->onKeyDown("MOUSE_BUTTON1"))
    SampleScript->callFunction(m_functionName);

161

(32 replies, posted in Plugins)

yes, I forget to add the object position :

unsigned int width = 0;
unsigned int height = 0;
system->getScreenSize(&width, &height);

float mouseX = input->getAxis("MOUSE_X");
float mouseY = input->getAxis("MOUSE_Y");

// ray
MVector3 origin = camera->getTransformedPosition();
MVector3 dest = camera->getUnProjectedPoint(MVector3(mouseX*width, (1.0f - mouseY)*height, 1.0f));

// bounding box
MBox3d * bbox = text->getBoundingBox();
MVector3 pos = text->getTransformedPosition();

if(isEdgeToBoxCollision(origin, dest, pos + bbox->min, pos + bbox->max))
    // intersection

or (slower but more correct) :

unsigned int width = 0;
unsigned int height = 0;
system->getScreenSize(&width, &height);

float mouseX = input->getAxis("MOUSE_X");
float mouseY = input->getAxis("MOUSE_Y");

// ray
MVector3 origin = camera->getTransformedPosition();
MVector3 dest = camera->getUnProjectedPoint(MVector3(mouseX*width, (1.0f - mouseY)*height, 1.0f));

// bounding box
MBox3d * bbox = text->getBoundingBox();

// local ray
MVector3 localOrigin = text->getInversePosition(origin);
MVector3 localDest = text->getInversePosition(dest);

if(isEdgeToBoxCollision(localOrigin, localDest, bbox->min, bbox->max))
    // intersection

162

(19 replies, posted in Editor)

Another variant :

http://anael.maratis3d.com/croquis/ui_mockup04.jpg

163

(19 replies, posted in Editor)

For info, here is the same UI in grey :
http://anael.maratis3d.com/croquis/ui_mockup_grey.jpg

And here is Unity :
http://tinmangames.com.au/blog/wp-content/uploads/GA1InUnity1200.png

3dsMax :
http://i0.wp.com/www.cgmeetup.net/home/wp-content/uploads/2013/08/3ds-Max-to-Unity-3d-3.jpg?resize=854%2C469

And Blender :
http://i0.wp.com/www.cgmeetup.net/home/wp-content/uploads/2013/11/UV-Unwrapping-and-Texture-Painting-in-Blender-Tutorial-1.jpg?resize=960%2C540

164

(19 replies, posted in Editor)

psikoT :
- Blue is really the identity of the editor, and every 3d softwares now looks similar. I made some experiment and blue is actually very zen and neutral, it also give a good contrast with text. But everything will be themable and not hard coded like the current UI, so it will be very easy to customize the colors.

- the top row buttons, do you mean the pacman, play, pause and stop buttons ?
It's true the size is not coherent and it could be smaller.

165

(32 replies, posted in Plugins)

1)How do we pick up behaviors? I did in this way, but does it mean that i take first behavior on object?

yes, and yes.
Just be sure there is a behavior before calling getBehavior(0), check how much behaviors are attached to the object by using getBehaviorsNumber().

2)where do i write runEvent?

yes, but I don't think you are allowed to set a default value for param in a virtual function : "int param=0"
do it this way :

void MouseClick::runEvent(int param) // use param as a code
{
    switch(param)
    {
        case 0:
        do_something();
        break;

        case 1001:
        scene_begin();
        break;

        // etc
    }
}

166

(19 replies, posted in Editor)

Another idea would be to replace the camera, light and text buttons by a "Add" Menu
and move the transformation buttons to the right, to gain more space :

http://anael.maratis3d.com/croquis/ui_mockup03.jpg

It is also less busy near the scene menu.
What do you think ?

167

(19 replies, posted in Editor)

Update :

http://anael.maratis3d.com/croquis/ui_mockup02.jpg

168

(19 replies, posted in Editor)

I'm happy you like it.

about that new console, is it meant to fully replace the floating console window (sooner or later) ?

This floating window was only there on windows, so in a way yes, but because the new editor will support multiple windows, we could add the option to extract the console from the main UI. The main idea is to give immediate feedback when an error message is detected. For example, when you start the game, if an error is detected in the script, the console will come up to show you the error.

does it means that some users could work on code proposals for interfaces in the future ?

I will be easier to add functionalities after the code cleaning, and it will be possible to add custom windows/buttons to the editor with plugins.

169

(19 replies, posted in Editor)

Hi all,

as I currently need to rewrite a lot of code on Maratis-Editor side, because of MGui2,
I taught it might be better to do a UI cleanup at the same time.

So I faked a possible new UI on photoshop, with suggestions from Vegas mockup and community in general :

http://anael.maratis3d.com/croquis/ui_mockup01.jpg

I'm also reorganizing the editor code itself to be more modular and to allow multiple windows
(copy of the main window or custom plugin window)

I removed the timeline on this screenshot, to replace it with a console that would come up when an error is detected.
But I'm still not sure if a timeline is still needed or not, or if a play/pause button is enough to preview the animations.

What do you think of the modifications ? do you prefer the old UI ?

170

(32 replies, posted in Plugins)

MBehavior don't have onBeginScene, it's only for MGame :
https://code.google.com/p/maratis/sourc … Behavior.h

But in your game's onBeginScene, you can call your native behaviors,
or you can call behavior->runEvent(someNumber) and implement "runEvent" in your behavior.

171

(3 replies, posted in Engine)

Hi Sponk,

good, I'm also moving to CMake using Dahnielson work in the experimental branch :
https://code.google.com/p/maratis/sourc … perimental

I'm currently cleaning and rewriting the editor to use MGui2 and unifying the different code bases.

By the way, there was already a standalone WAV loader here I don't know if you noticed :
https://github.com/Sponk/Maratis-1/blob … Loader.cpp

172

(2 replies, posted in Scripting)

Hi, in general, intensive calculation (like physics, or complex AI) should be done in C++, and the "game" logic in lua.

Lua is one of the fastest dynamic langage, it will basically run 2 to 50 times slower than C/C++.
There is also an optimized version of Lua called "LuaJIT" that actually compiles Lua at runtime, and will run 1 to 2 times slower than C/C++ only. But runtime compilation is not allowed on all platform (like iOS).

173

(32 replies, posted in Plugins)

Don't forget to declare your behavior in StartPlugin :

void StartPlugin(void)
{
    // get engine
    MEngine * engine = MEngine::getInstance();

    // add behaviors
    MBehaviorManager * behaviorManager = engine->getBehaviorManager();
    behaviorManager->addBehavior(MouseClick::getStaticName(), M_OBJECT3D, MouseClick::getNew); // here
}

174

(32 replies, posted in Plugins)

In this case you can use the bounding box of the text and send a ray :

unsigned int width = 0;
unsigned int height = 0;
system->getScreenSize(&width, &height);

float mouseX = input->getAxis("MOUSE_X");
float mouseY = input->getAxis("MOUSE_Y");

// ray
MVector3 origin = camera->getTransformedPosition();
MVector3 dest = camera->getUnProjectedPoint(MVector3(mouseX*width, (1.0f - mouseY)*height, 1.0f));

// bounding box
MBox3d * bbox = text->getBoundingBox();

if(isEdgeToBoxCollision(origin, dest, bbox->min, bbox->max))
    // intersection

175

(32 replies, posted in Plugins)

: ) good

for MLOG_ERROR and MLOG_WARNING, is it just not printing the message in the console like I experienced or is it making the plugin crash ?