Rojo3d. 3D engine for Construct 2

3 favourites
From the Asset Store
Casino? money? who knows? but the target is the same!
  • Glad you’ve found it useful. I’m not currently developing it further. I coded myself into a corner and would need to take time to figure out the best way to rewrite it and I don’t have the same momentum or time to do that at this time.

    Its great little plugin. I just programmed hightmap generator from noise.

    I'd acctually say that more important then 3d physics or animations would be fixing shadow issues, adding another light options for extra lights, and adding more texturing options.

    It would be really nice if this plugin would get updated. Really!

  • R0J0hound Maybe you could help me with something. I am trying to figure out how to set Z for the characters properly. I was trying to get z it from noise but it's too chaotic for some reson and the camera is going up and and down while moving in quite extreme ways. SO I stored noise peaks in array and atm I am only dividing player x and y by tilesize and then lerping from players z to array z very quickly. But I think that if I'd set players z from quad's 4 Z vertexies it would work better, but I have not much idea how to do that. I think I'd have to check first if player is within that quad with X and Y and Z and then set players Z based on distances to the edges Z's? If you could advice, please do. Best M

  • Well depending on how you’re doing the noise you will have a function noise(x,y) which you can scale and offset with noise(x*scale+offsetX, y*scale+offsetY), or maybe you’re just setting random values to a 2d array.

    Anyways let’s say for example you want a 2d grid with a point every 32 pixels. Just have a 2d array of z values.

    You can get the nearest point’s z with

    Z = Array.at(round(x/32), round(y/32))

    Or if you want a linear interpolation between the points it would be:

    Z = lerp(

    lerp(array.at(int(x/32),int(y/32)), array.at(int(x/32)+1,int(y/32)), x/32-int(x/32)),

    lerp(array.at(int(x/32),int(y/32)+1), array.at(int(x/32)+1,int(y/32)+1), x/32-int(x/32)),

    Y/32-int(y/32))

    Or something like that. Google bilinear interpolation for other explanations. You can also do bicubic interpolation but that’s more involved albeit gives curved interpolation. Or you could use cosp instead of lerp.

    Anyways, it’s a bit harder to reason about 3d problems from descriptions.

  • Well depending on how you’re doing the noise you will have a function noise(x,y) which you can scale and offset with noise(x*scale+offsetX, y*scale+offsetY), or maybe you’re just setting random values to a 2d array.

    Anyways let’s say for example you want a 2d grid with a point every 32 pixels. Just have a 2d array of z values.

    You can get the nearest point’s z with

    Z = Array.at(round(x/32), round(y/32))

    Or if you want a linear interpolation between the points it would be:

    Z = lerp(

    lerp(array.at(int(x/32),int(y/32)), array.at(int(x/32)+1,int(y/32)), x/32-int(x/32)),

    lerp(array.at(int(x/32),int(y/32)+1), array.at(int(x/32)+1,int(y/32)+1), x/32-int(x/32)),

    Y/32-int(y/32))

    Or something like that. Google bilinear interpolation for other explanations. You can also do bicubic interpolation but that’s more involved albeit gives curved interpolation. Or you could use cosp instead of lerp.

    Anyways, it’s a bit harder to reason about 3d problems from descriptions.

    Thanks for reply. Tried the lerp first, but couldn't get it to work. However went back to original idea using noise value and fixed what was wrong with the function. :)

  • R0J0hound

    Can you help me? I think I understood how the camera X, Y, Z angle works, but at the same time is too complex. There is something I am missing? I did a lot of tests, I can't explain how it works, but I understood how it works.

    Basically what I need is a simplified version of the Camera X, Y, Z angle, how do I get it? There is orientXX("camera"), orientXY("camera").....orientZZ("camera"). Some 3D programs only use Angle X and Angle Y to look around...

  • With this plug-in orientation is as complex or as simple as you like. You can set the orientation with the look at action, or you can rotate incrementally. Like if you like xyz angles you would rotate by x, then y and then z. I was shooting for maximum flexibility and just doing Euler angles wasn’t useful.

    The orient expressions get values from the 3x3 orientation matrix. I guess if you want to get the Euler angles you can either save them in variables as you do the rotations to access later, or there’s probably a formula for it.

  • Sry for my bad english...

    Yes! You explained what I couldn't... That it works in 3x3 matrix. I understand it, just can't figure out how to make it works. Thank you anyway.

    Sorry for bothering you.

    Basically what I am trying to do is to sync the Rojo 3D camera orientation with another C2 3D plugin Camera... If the Rojo 3D Camera moves 3 pixels to the Y direction, the other camera also will move 3 pixels to the Y direction. (Yeah its pretty hard, Rojo 3D camera looks like it's using values from cos, sen and tan? As I said, I can't explain, because it's harder to explain in other language and harder if there is no image to exemplify).

    Why I am doing this? I can make "two games" to be running at the same time, the Rojo 3D plugin loads the 3D objects (texture and 3D obj) and the other 3D plugin runs the 3D physics behavior.

  • There likely can be differences with this and other plugins. The z direction could be positive in the other way. With this you can set the angle with (x,y,z) Euler angles. Other plugins could rotate in a different order like zyx. You can do that with multiple actions

    Set angle to (0,0,z)

    Rotate by (0,y,0)

    Rotate by (x,0,0)

    And like I said before to get the angle it gives it in a 3x3 matrix. You can either convert that with a formula you can find online or you can save the Euler angles to variables.

    The solution you’re after is probably some combination of the above. I’m not going to attempt a solution as this plug-in is mostly self contained and I only made sure it works with a minimal set of other construct features.

  • I am very thankful for your reply, I'll do my best <3

    Sorry if I bothered you.

  • I've been very much out of the loop and just recently noticed this plugin. Finally coming around to check out these examples and I'm impressed. Surely seems like the single best option for real 3D in C2. Great work!

  • Rojo, sry for bothering you again, but do you have any tip? I am trying to remove the black borders from the screen (letterbox scale), but when I use any other (except for letterbox scale integer and "Off") everything gets wider... There is anyway to solve it?

    P.S. doesn't matter if I use anchor or not, it doesn't change.

    P.S.S. I understood why Euler Angles was so confusing and all the other things, and searched a way to convert from rotation matrix to Euler (results: it's better to just use from one of those camera examples you made)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hi,

    No bother at all to ask questions.

    Best I recall I made it work with 640x480, so it should work with any size with the same aspect ratio. Anything else would stretch I suppose. I didn’t test with the other scaling modes so I probably didn’t account for some nuances with how they work. I don’t think there is a solution apart from modifying the plug-in. Unfortunately I’ve been prioritizing my time elsewhere as of late. So examples or plug-in modifications will be rarer, but I can still answer questions as those don’t require me to actually be at a computer.

  • Sorry if this is obvious but I can’t seem to figure out how to get an animation to play. (i.e. enemy walk, attack)

    Is there a specific way of doing this?

  • You have to set the texture from a sprite every tick, or at least every time the frame changes. Otherwise it will remain on the last texture used.

  • I was trying to get a splatoon like effect where you can "paint" the ground. to do this I have combined the effects of the canvas plug-in.

    for each "ground" I create a canvas (for different heights) and link the canvas to the ground. then paste a "paint" object to the canvas and then load the canvas image from url. it works well.

    however, there is a flash from the 3d object when the texture updates. is there a way around this?

    I have attached a capx based off the billboarding example.

    drive.google.com/file/d/1095dD0HsGEetacL-waQpMymezb71hCl3/view

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)