3D Python Camera

This forum is currently in read-only mode.
0 favourites
From the Asset Store
Simple and easily editable template for a dynamic camera that zooms in and out based on how far apart the players are.
  • Usually, if the .cap needs particular python files, and if you haven't got python installed, or they aren't included by reference(e.g. sys.path=[System.AppPath + 'py3'] where the folder py3 has the needed files), then you get a traceback error (no module installed).

    That's from my experience anyway.

    zen

  • It's a bug, easy fix though. Just delete the original (Had to click it on the tool bar or Construct would crash). Then make a clone of the other blocks, container it with the blue map blocks, paint the 3d one as you please, and you should be good.

    All you need to do to create new map pieces is create an object with a map family and one with a world family, set the world to destroy on startup ,and container them together and the rest will sort itself out.

    Edit: Cap should be fixed now.

  • It's a bug, easy fix though. Just delete the original (Had to click it on the tool bar or Construct would crash). Then make a clone of the other blocks, container it with the blue map blocks, paint the 3d one as you please, and you should be good.

    All you need to do to create new map pieces is create an object with a map family and one with a world family, set the world to destroy on startup ,and container them together and the rest will sort itself out.

    -------------------------------------------------------

    Any chance you could give a step by step on the above, I'm struggling to understand.

    Why do i have to clone the blocks? (is it because of the container)

    What do the blue map blocks do?

    (I have mentioned 2 things here, but i'm not 10o% sure about the rest!)

    <img src="smileys/smiley9.gif" border="0" align="middle" />

  • > It's a bug, easy fix though. Just delete the original (Had to click it on the tool bar or Construct would crash). Then make a clone of the other blocks, container it with the blue map blocks, paint the 3d one as you please, and you should be good.

    >

    > All you need to do to create new map pieces is create an object with a map family and one with a world family, set the world to destroy on startup ,and container them together and the rest will sort itself out.

    -------------------------------------------------------

    Any chance you could give a step by step on the above, I'm struggling to understand.

    Why do i have to clone the blocks? (is it because of the container)

    What do the blue map blocks do?

    (I have mentioned 2 things here, but i'm not 10o% sure about the rest!)

    <img src="smileys/smiley9.gif" border="0" align="middle" />

    You're cloning one of the other blocks just to save time. You could also just make a new one and apply the "world" family

    The map your looking at is an over head of the 3d world. Each of the blocks on the map represents one in the 3d world. The blue map blocks represent the blue 3d ones. If you alter the position or size of one, the 3d one will change accordingly. All the map blocks also have two PV's for the 3DHeight and 3DY. The latter being where the bottom of the block will be the later how high it extends upward.

    The map is calculated at 1/4 world space to save space. So a map block 16px wide would create a 3dblock 64px wide. This does not apply to the map objects's private variables,

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • "It's a bug, easy fix though. Just delete the original (Had to click it on the tool bar or Construct would crash). Then make a clone of the other blocks, container it with the blue map blocks, paint the 3d one as you please, and you should be good."

    Sorry....still having problems.

    1, I deleted the WWall2(3dbox) by right clicking on it in the object list and choosing delete). Then i deleted and all the mwall2(sprites), but when i run the cap it crashes?.

    2, "Had to click it on the tool bar" Whats the toolbar?

    I am probably missing something simple...but i dont know what.

    <img src="smileys/smiley9.gif" border="0" align="middle" />

  • i think pythons causing this to be slower if anything, or at least your implementation of the code, because i made this with events, well something highly similar (yaw pitch 3d camera with boxes and stuff), and with 3 times the objects and high poly 3d objects im getting like 800 fps, vs 80 with yours. ill post it up in a bit.

  • Sorry, my bad, I meant the object bar.

    You didn't have to delete MWall2s. The WWall2 was the problem. The instruction I gave were to replace it. Mind you, you are going to get error if a map or world object doesn't have a counterpart. Are you sure you deleted all the blue blocks?

    Anyway, I've fixed the cap. So just redownload it.

  • Sorry, my bad, I meant the object bar.

    You didn't have to delete MWall2s. The WWall2 was the problem. The instruction I gave were to replace it. Mind you, you are going to get error if a map or world object doesn't have a counterpart. Are you sure you deleted all the blue blocks?

    Anyway, I've fixed the cap. So just redownload it.

    I probably deleted the wrong stuff...anyway,Iv'e download the new cap and its sorted now, thanks.

    Going back to your first post:

    "I'm concerned with the speeds I'm getting, wondering if it's just my computer, Construct itself, the 3DBoxes themselves, python, or just my own bad programming killing speeds. Right now I'm doing 60-80fps, and taking away all but a few objects only yields about a 40fps gain"

    I change a few textures and moved stuff around and it went from 55/60 fps(0.850 vram) to 160 fps(0.290 vram).

    I did delete some of the sprites, but had over 20 objects on screen.

    <img src="smileys/smiley5.gif" border="0" align="middle" />

    If you want a copy of my cap let me know.

  • By all means post it

  • By all means post it

    cap

    (using Yarfapets 3D python example)

    I changed the layout and window to 800x600, so it might be a bit slower?

  • > By all means post it

    cap

    (using Yarfapets 3D python example)

    I changed the layout and window to 800x600, so it might be a bit slower?

    Nice, a few simple changes can do so much. Even with the resolution bump I'm still getting more than 2.5x the speed I was getting before (200-250fps average).

    One quick note though, the formulas used are resolution dependent.

    WorldObj[n].X=WorldObj[n].X+320 (Should be half the horizontal res)

    WorldObj[n].Y=WorldObj[n].Y+272* (Should be half the vertical res)

    In this case

    WorldObj[n].X=WorldObj[n].X+400

    WorldObj[n].Y=WorldObj[n].Y+300

    *Yeah, I just realized I screwed that up too

  • Yarfapet

    If i add a 3d model(.obj), the cap shows an error.

    Any way to stop this?

    <img src="smileys/smiley5.gif" border="0" align="middle" />

  • Rename 3dobject so that it's name doesn't start with a number. Python doesn't work with names that start with numbers.

  • Rename 3dobject so that it's name doesn't start with a number. Python doesn't work with names that start with numbers.

    The cap still wont run wont run?

    1, I opened the cap, created a 3d object (called 'crates.obj')

    2, Gave it a texture.

    3, Ran the cap

    4, Crashed, with the following errors:

    <img src="http://dl.dropbox.com/u/22173473/3dcamerror.png" border="0" />

  • Could you post or send the cap? I have a small hunch what it might be, although I'm still somewhat of a novice and can't really tell just from the errors.

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