You need to create texture coordinates by unwrapping your mesh in Blender :
http://wiki.blender.org/index.php/Doc:2
Unwrapping
151 2014-06-20 22:08:08
Re: Few issues with blender (4 replies, posted in Editor)
152 2014-06-20 10:42:50
Re: Few issues with blender (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 :
read this documentation carefully : http://www.maratis3d.org/?p=277
153 2014-06-18 05:52:28
Re: Problem with linux (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 2014-06-15 20:11:09
Re: TD Speed Projects (Post some) (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 2014-06-15 15:30:24
Re: Distance examples (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 2014-06-15 11:13:22
Re: Distance examples (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.
157 2014-06-06 11:39:35
Re: blender mesh with animation(changing alpha) (4 replies, posted in External Tools)
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)"
158 2014-06-06 10:22:07
Re: blender mesh with animation(changing alpha) (4 replies, posted in External Tools)
Hi, you should look at this tutorial : http://www.maratis3d.org/?p=277
You can animate the "Alpha" value :
- 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 2014-06-03 20:26:38
Re: Programming question (32 replies, posted in Plugins)
I can see the video now, promising !!
160 2014-06-03 14:16:41
Re: Programming question (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 2014-06-01 18:38:23
Re: Programming question (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
163 2014-05-30 13:33:58
Re: UI Mockup (19 replies, posted in Editor)
For info, here is the same UI in grey :
And here is Unity :
3dsMax :
And Blender :
164 2014-05-29 19:04:22
Re: UI Mockup (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 2014-05-29 17:36:44
Re: Programming question (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 2014-05-28 13:20:40
Re: UI Mockup (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 :
It is also less busy near the scene menu.
What do you think ?
168 2014-05-27 09:58:00
Re: UI Mockup (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 2014-05-26 10:35:55
Topic: UI Mockup (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 :
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 2014-05-25 15:43:34
Re: Programming question (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 2014-05-23 19:50:44
Re: Maratis on CMake and SDL2 (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 2014-05-23 18:13:10
Re: Scripting Performance (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 2014-05-21 12:29:46
Re: Programming question (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 2014-05-20 13:24:27
Re: Programming question (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 2014-05-20 06:51:50
Re: Programming question (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 ?