1

(1 replies, posted in Showcase)

been away from maratis for awhile, just said i'd give it a look at again.

here's a video of a little project i'm working on.

https://vimeo.com/197737799

let me know what you think of the idea.

I actually figured it out:

Camera =getObject("Camera0")
player = getObject("Entity0") 



function onSceneUpdate()
colorr=math.random(0, 2)
colorg=math.random(0, 2)
colorb=math.random(0, 2)




mx = getAxis("MOUSE_X")
my = getAxis("MOUSE_Y") 
mz = 0.0   

cursor3d = getUnProjectedPoint(Camera, vec3(mx, my, mz))
print(cursor3d[1], cursor3d[2], cursor3d[3])
setPosition(player, {cursor3d[1], cursor3d[2], mz})






Camera = getCurrentCamera()
enableCameraOrtho(Camera, true)
setCameraClearColor(Camera, {colorr, colorg, colorb})




end

this will set player cords to mouse.

so heres my simple code:

Camera =getObject("Camera0")
player = getObject("Entity0") 



function onSceneUpdate()
colorr=math.random(0, 2)
colorg=math.random(0, 2)
colorb=math.random(0, 2)




getX = getAxis("MOUSE_X")
getY = getAxis("MOUSE_Y")

var1 = updateMatrix(getX)
print (var1)



Camera = getCurrentCamera()
setCameraClearColor(Camera, {colorr, colorg, colorb})




end

i'm trying to set the position of player to mouse position but when i use "getAxis("MOUSE_X") it throws out a strange float, what can i do with this data?

4

(2 replies, posted in General)

Well is more of a time scale?

5

(2 replies, posted in General)

Any way to slow framerate down in maratis with lua?

Heres the project:  https://drive.google.com/folderview?id= … sp=sharing

It still falls off the side of the earth tho? how do i make the gravity flip?

Thanks very much anael. this help me understand vectors better.

This is what i have but cant get it to work.


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


-- scene update
function onSceneUpdate()

    gravity = {0, 0, 0}
    setGravity(gravity) -- set current scene gravity
   
    addCentralForce(earth, {0, 0, 0}, "local")
    end
   
end

How to apply a gravitational force to an object? i want to make a sphere and the player walk 360 around it?

well i guess nobody knows

This is the code i still cant figure it out? It's just the sponza tutorial with a sphere in it

Player = getObject("Player")
Head = getObject("Head")
room = getObject("room")
sphere = getObject("sphere")

dx = 0.0
dy = 0.0

centerCursor()
mx = getAxis("MOUSE_X")
my = getAxis("MOUSE_Y")

-- scene update
function onSceneUpdate()

    playerPosition = getPosition(Player)
    vec = normalize(sphereCenter - playerPosition)*0.98)

    -- rotate Player (X mouse)
    rotate(Player, {0, 0, -1}, dx*100)
    
    -- rotate Head (Y mouse)
    rotate(Head, {-1, 0, 0}, dy*100, "local")    
    rotation = getRotation(Head)
    if rotation[1] > 90 then
        rotation[1] = 90
    elseif rotation[1] < -90 then
        rotation[1] = -90
    end

    setRotation(Head, rotation)
    
    -- move    
    if isKeyPressed("W") then
        addCentralForce(Player, {0, 6, 0}, "local")
    end
    
    if isKeyPressed("S") then
        addCentralForce(Player, {0, -6, 0}, "local")
    end
    
    if isKeyPressed("A") then
        addCentralForce(Player, {-3, 0, 0}, "local")
    end

    if isKeyPressed("D") then
        addCentralForce(Player, {3, 0, 0}, "local")
    end    
    
    if isKeyPressed("SPACE") then
        addCentralForce(Player, {0, 0, 3}, "local")
    end    
    
    -- get mouse direction
    dx = getAxis("MOUSE_X") - mx
    dy = getAxis("MOUSE_Y") - my

    -- center cursor
    centerCursor()
    hideCursor()
    gravity = {0, 0, -90}
    
    mx = getAxis("MOUSE_X")
    my = getAxis("MOUSE_Y")    
    
end
(

how do i get the player position and center of sphere? I don't really understand

So i want to walk 360 (anywhere) around the surface of a sphere without falling off how do i achieve this?

Here a diagram of what i want to do the cube is the FPS player and the sphere is the earth:
http://imgur.com/HHU1TeL

15

(3 replies, posted in General)

Yes that worked thank you.

sudo apt-get install libopenal1:i386

16

(3 replies, posted in General)

When i run maratis from the terminal it throws out :  ./MaratisEditor: error while loading shared libraries: libopenal.so.1: cannot open shared object file: No such file or directory

How do i fix this? i running ubuntu 14 64bit.

I can't see why it wouldn't be supported since it's just a glsl shader.

(can you please move this to general i didn't mean to post this in news)

Overall maratis is a great engine/editor but i have noticed the edges on my models can be pixelated at the edges, Can anything be done about this.