R0J0hound's Forum Posts

  • newt

    Probably, the loading is done with an ajax request and it can know when it fails. I'm not updating plugins now though.

  • Here's demonstration of a way to run some webgl and display the result on a sprite (not minifier friendly):

    https://www.dropbox.com/s/iq4xmleoeqkb1 ... .capx?dl=0

    It may be useful as a base to do what's asked for in the op.

  • To get it to work in preview mode with nwjs here is a strategy I've used.

    global text appfolder="c:\myfolder"

    Start of layout

    [negated] is preview

    --- set appfolder to nwjs.appfolder

    Basically, if you're in preview just use a direct folder path, otherwise use the nwjs.appfolder expression.

  • If you use the nwjs export/preview you can use the readfile expression of the nwjs object to read a local file.

    For a normal HTML preview the browser should prevent access to local files. If you export as html you should be able to access files in that same folder if you just use "nomes.txt".

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I probably rambled too much. Maybe this is helpful?

    https://www.scirra.com/manual/141/files

  • If you added the files from inside c2 the second should work. There's also the "request project file" action.

    I said "from inside c2" because I'm not sure just adding the the files in your project folder from Windows explorer is enough. I think there's an xml file the c2 uses to list the files, but c2 takes care of that when adding the files from the editor. If you are using the editor to add the files then disregard.

  • It's possible in c2. The simplest way would be to find a Babylon3d or q3d example that just loads and displays a model, then just load that in the iframe plugin I'd guess. I'm refering to the actual JavaScript libraries and not the plugins.

  • I think the server the file is on needs to allow an Ajax request or I think the wording is cross domain requests. Typically I just put files in the files folder of the project and not worry about it. You should also be able to upload the file the same place you uploaded your html export to. Although I guess you're using some other kind of export.

    I think there is an "on error" condition in the Ajax object that could be used to probably get an error message. You could also see if there's any settings you can set for the server you uploaded to? My guess is unless it's your own server you won't have control over that. Or maybe just try uploading somewhere else?

  • I'm not sure that link would help.

    You can do the projectile motion by giving the ball two variables: vx and vy

    Then the motion is done with one event:

    Global number g=100

    Every tick

    --- ball: add g*dt to vy

    --- ball: set y to self.y+self.vy*dt

    --- ball: set X to self.x+self.vx*dt

    g is the gravity value. Next you can do bouncing with:

    Ball overlaps head

    Ball: vy>0

    --- Ball: set vy to -self.vy

    --- ball: set vx to g*(otherhead.x-self.x)/(-2*self.vy)

    So that will make the ball bounce back up to basically it's original height and vx is set so the ball will land on some other head.

    That formula can be found by using these two projectile motion equations:

    Y=y0+vy*t+0.5*g*t^2

    X=x0+vx*t

    Just solve for vx with the simplification of y=y0. Solve it without the simplification if you want the ball to land on different heights.

    On a final note, you can make the height the ball bounces back to by changing the "set y" action to:

    Ball: set y to self.y+self.vy*dt+0.5*g*dt*dt

    And moving the set vy action below it.

  • That pretty much just reduces the point count from 3991 to 328 which would give a speed increase. The model could always be made with a lower point count, and having the points uniformly spaced like that probably is preferred to the random sampling.

    That all could be done beforehand, and just use the rotation method we already have.

    Edit:

    I haven't done much work on the capx lately. I've been playing around with doing it in c and basic OpenGL to see the speed difference. 2% cpu vs 35% and it looks like I'm getting 60fps. Hmm, that was refreshing. Might try webgl and JavaScript next.

  • In your proposed algorithm step 1 requires sorting all the points into those bounding boxes, then in step 2 those would need to be sorted again by z. It would perhaps work well I you pre-calculated all of that but then you'd be stuck at one view angle.

    [quote:2cxp6ej9]The reason i got so high framerate before by only rotating in one axis, was because i rotated all the points as one entity. I did not need to calculate any new positions for them. I pinned them to a dummy sprite, and rotated the dummy sprite instead. Maybe somehow this could be done for each axis?

    That would only work for an xy rotation, if I understand it correctly.

  • I need to wait till C3 is actually released.

  • This link explains the math of a physics bounce:

    https://gamedevelopment.tutsplus.com/tu ... medev-6331

    I always found it hard to fake physics because it never looks right.

  • That sounds similar to a SVO (sparse voxel octree) which is commonly used for rendering/storing voxels. Here's a link with some code to find the intersection of a ray and the octree that I may study a bit more later.

    http://stackoverflow.com/questions/1022 ... algorithms

    Right now we're just transforming all the points and basically rendering all of them. Next would be to just use a uniform 3d grid of voxels or a SVO and cast a ray for every pixel we want to display. Ray casting on a uniform grid could be done with a line drawing algorithm like dda. I'm uncertain it will be faster than what we're doing now, due to the overhead of events adding up and sometimes providing no gain. It may be interesting to try that approach, as it also would eliminate the holes on the model.

  • rexrainbow

    It may take a while for me to post new links. I neglected to plan ahead and don't have anything set up.

    edit:

    new link posted