1 - name your objects : "earth" and "player"
2 - import the script in the scene :
http://wiki.maratis3d.org/index.php?tit … to_objects

but be sure the origin of hearth and player are centered in the mesh

you need a direction vector, in your code it's all zero.

-- get objects
player = getObject("player")
earth = getObject("earth")

setGravity({0, 0, 0}) -- set current scene gravity to zero

g = 0.98 -- your new hand made gravity force

-- scene update
function onSceneUpdate()
   
    vec = normalize(getPosition(earth) - getPosition(player)) * g
    addCentralForce(player, vec)
    
end

well, you can first set the gravity to zero with setGravity :
http://wiki.maratis3d.org/index.php?title=SetGravity

and then at each frame add a central force with a vector going from the object to the center of the sphere.
with addCentralForce : http://wiki.maratis3d.org/index.php?tit … ntralForce

55

(6 replies, posted in Tutorials/Examples)

did you do that :
http://www.maratis3d.com/wp-content/uploads/2011/01/02.jpg
(see doc)

56

(6 replies, posted in Tutorials/Examples)

click on "+"
set "start" frame and "end" frame

do that multiple times if your mesh is composed of multiple animations (need to be on the same timeline, one after each other)

57

(6 replies, posted in Tutorials/Examples)

Hi,

did you add an animation and it's frame-range here :
http://www.maratis3d.com/wp-content/uploads/2011/01/12.jpg

doc : http://www.maratis3d.org/?p=277

58

(22 replies, posted in Off-Topic)

On x64 platform it should be by default, because SSE is a part of x64 standard, you may need to use "-O3" flag though.

But on 32bit it's not, so you need to add a compiler flag, on gcc it's "-msse2" ("-O3" may be needed too like above).

"-ffast-math" flag can also improve it. But it's potentially unsafe.

59

(22 replies, posted in Off-Topic)

Normally the compiler will use SSE instructions when the code is linear and simple to vectorize like the raytracing functions (I tried to use intrinsic on the ray-triangle code but there was no speedup compared to the compiler).

But in maratis mesh tools, it was a good speed-up : (see void blendMatrices)
https://code.google.com/p/maratis/sourc … hTools.cpp

60

(22 replies, posted in Off-Topic)

I published a first version of the tiny C code we were talking about :
https://github.com/anael-seghezzi/Marat … -C-library

Still need to link it completely with MCore to publish the rest.

61

(4 replies, posted in Showcase)

Good effort, congrats.

I should take a look at this sound problem,
did you try to install OpenAL and OpenAL dev libraries ?

62

(22 replies, posted in Off-Topic)

Yes, it's in the wind like pure old school 2d, a voxel is just a 3d pixel, it means "volumetric pixel",
it often looks like cubes, but in fact it is more like a stack of bitmaps (the stack being the Z dimension),
and because it's packed and aligned, it can be traversed very fast, using ray-casting or ray tracing.

When parsed directly it can render as cubes (like minecraft) or smoothed cubes depending of the filtering,
but it can also be converted to triangles using "marching cubes" and create smooth surfaces.

voxels are also used to accelerate the parsing of a scene for raytracing, like a fixed size octree.

63

(22 replies, posted in Off-Topic)

Voxel based rendering could be done with the base code, as other things, not as a full-feature engine though, something for little games or educational purpose. Well that's just an idea.

In fact I did some test some months ago in Maratis standard renderer : https://code.google.com/p/maratis/sourc … nderer.cpp

It's commented, but if you look at MStandardRenderer::updateVisibility
there is some test code to draw the voxels of the scene in software. The idea is to compute a low-res occlusion culling map on the cpu to avoid the overhead of hardware occlusion culling. It's not complete yet, but it renders voxels from a mesh.

64

(22 replies, posted in Off-Topic)

The SDL2 / GLFW versions can be handle with a define, in the code or in cmake.

My interest in software rendering is for multiple reasons, the first is to experiment different techniques and general image processing (not necessarily real-time), second is that we are entering a phase where GPUs are general purpose, so it opens a lot of possibilities.

In the indie scene, games are often trying to reproduce pixelized images on modern ultra-powerful GPUs. In this low resolution it is already possible to use software rendering to do different things, like hybrid rendering, ray-casting, (selective) ray-tracing, non-realistic rendering...

Voxatron does that in CPU, targeting old computers : http://www.lexaloffle.com/voxatron.php

Of course it's useless to reproduce very effective hardware techniques like shader based rasterization.

65

(22 replies, posted in Off-Topic)

That sounds good.

I guess SDL2 is more supported than GLFW, but GLFW is lighter, the best would be to keep both alternatives, if it's not too hard to maintain. We could just have multiple versions of MGUI_xxx.cpp.

I'm not sure about direct support for OpenCL or Cuda, but it would be nice if some of the high performance code could compile for both GPU and CPU (without having to rewrite it). I took some more interest in software rendering recently, I taught I'll share it.

OpenCL is on mobile already, and it's probably something that we will start to find more and more.

Like you said, there is a lot of AAA engines out there now, I'm thinking about different directions to experiment. Like software rendering (in CPU or GPU), image processing, simplicity.

A deffered renderer is interesting, tell me how it goes, I don't know much about real-time physically based shading.

66

(22 replies, posted in Off-Topic)

Hi jurgel,

I'm doing some cleaning in the code base right now, mainly to separate the low level code into a small C library, it won't affect the c++ code compatibility but I'd like to finish that before sending it to github.

I'm also including some other image processing code I have not shared yet, like additional ray-tracing code, some basic software rasterization, image filters etc. I'm using C here to make some of this code also usable in OpenCL or Cuda.

I just saw you did some good work on your github page, we can try to synchronize at some point, did you manage to compile the experimental branch with SDL2 instead of GLFW ?

67

(3 replies, posted in Engine)

collision objects are created during MScene::begin automatically,
to add collision objects later on, you need to do it manually.

Normally you can call this to create the collision object of an entity if it was not done at scene begin (call it only once, it is not checking if it was already done) :

scene->prepareCollisionShape(entity);
scene->prepareCollisionObject(entity);
scene->prepareConstraints(entity);

68

(3 replies, posted in Engine)

Hi,

getUnProjectedPoint is low level, you need to give exact pixel position in viewport space.
If you are in full screen, by multiplying by the screen size + reversing y coordinates :

MSystemContext * system = engine->getSystemContext();
    
unsigned int width = 0;
unsigned int height = 0;
system->getScreenSize(&width, &height);

x = x * width;
y = (1.0f - y) * height;

In lua it's done transparently.

69

(22 replies, posted in Off-Topic)

Yes, I received a notification,
github is the right move yes : )

70

(1 replies, posted in General)

Hi, it's not a release but there is this build test from the current main branch of the code :
http://forum.maratis3d.com/viewtopic.php?id=1034

Otherwise a possible new version is under work in the experimental branch, with some major rewrite of the code :
https://code.google.com/p/maratis/sourc … perimental

71

(2 replies, posted in Showcase)

Hey, sounds interesting, I'll try that on linux.
Do you have any screenshot or video ?

72

(32 replies, posted in Plugins)

Hi !
here you are :

MOEntity * entity = (MOEntity *)parent; // be sure that parent is an entity
MPhysicsProperties * phyProps = entity->getPhysicsProperties();
unsigned int objId = phyProps->getCollisionObjectId();

73

(3 replies, posted in Off-Topic)

The site is back,
some memory problem it seems...
Sorry about that.

74

(3 replies, posted in Off-Topic)

Yes, thank you for reporting.
I contacted the company hosting the websites, I'm waiting for a reply, I'll keep you informed.

75

(9 replies, posted in Gossip)

So 111th position overall : http://ludumdare.com/compo/ludum-dare-3 … ;uid=45582
That's cool I'm quite happy for a little experiment !