Jump to content

[Very much in Progress] SamacEditor


joshcamas
 Share

Recommended Posts

Quick Question: Does anyone know how to load a json file in the background, without "pausing" the game?

 

This is to load land chunks while your playing and editing, but right now I'm using the $.getJSON function, and it freezes the game until it finishes loading D:

Link to comment
Share on other sites

You can do it with $.ajax that loads a php file itself Json load your file and returns it in an echo that you recovered in success: function (data)

$.ajax({ url: "file.php", type:'POST', data:"donne="+ res,    success: function(data){             }});

Works very well for me

Link to comment
Share on other sites

Not sure if you are still having troubles with clicks translating correctly, but I think it has to do with the fact that the Firefox's click event behaves differently than Chrome's. the evt.offsetX and evt.offsetY are undefined in Firefox (at least when I was testing it) and it seems that some of your clicking code uses the same. I was having troubles with mozilla clicks also and I noticed this similarity and started looking into (I haven't solved it, but this seems to be a clue in doing such).

 

Here is a reference to the Mozilla developer page about click events:

 

https://developer.mozilla.org/en-US/docs/Web/Events/click

 

Hope it helps.

Link to comment
Share on other sites

Not sure if you are still having troubles with clicks translating correctly, but I think it has to do with the fact that the Firefox's click event behaves differently than Chrome's. the evt.offsetX and evt.offsetY are undefined in Firefox (at least when I was testing it) and it seems that some of your clicking code uses the same. I was having troubles with mozilla clicks also and I noticed this similarity and started looking into (I haven't solved it, but this seems to be a clue in doing such).

 

Here is a reference to the Mozilla developer page about click events:

 

https://developer.mozilla.org/en-US/docs/Web/Events/click

 

Hope it helps.

Ahhh! That would explain it! Thank you very much, I'll test fixing this!

 

 

You can do it with $.ajax that loads a php file itself Json load your file and returns it in an echo that you recovered in success: function (data)

$.ajax({ url: "file.php", type:'POST', data:"donne="+ res,    success: function(data){             }});

Works very well for me

If I'm not mistaken the current $.getJSON function is actually a slightly edited $.ajax function.

Is there something with this function that doesn't pause the javascript? :)

 

EDIT: Yeah, the $.getJSON is equal to:

 

$.ajax({

dataType: "json",
url: url,
data: data,
success: success
});
 
 
Link to comment
Share on other sites

  • 6 months later...

Ahh, ya caught me sneakin' around in the back alleys, DB.  :)  Yeah, I heard a rumor that Josh b'Gosh was painting on texture-coated mesh, in SAMAC.  I thought maybe I could borrow some code... to answer your "x.y pointer events to UV mapping" question.  Now I find out that Josh of the Jungle... is missing, too, just like Alby.  I wonder if the two of them are making out in the bushes, somewhere.  j/k

 

Did you get a fairly new version of Samac, before Josh when ghostly?  He's painting on heightMaps, eh?  His editor was really targeted to ground/heightmaps, if I remember correctly.  I don't know if he ever tried painting textures that were mapped onto other shapes, or not.

 

Anyway, we miss you Josh.  Hurry back. 

 

DB, I have more to say (when don't I?) and I'll meet you over in your new topic.  No, just leave your motorcycle alone, and WALK over to the other topic thread.  Friggin' scooterhead.  :)

Link to comment
Share on other sites

IT seems to me that Josh was talking to recreate his editor with other languages compiled ​​like C# + XNA or C++. IT was therefore questioned its project with the use of Babylon.

I guess he abandon Babylon.  :(

 

I could be wrong, but I remember me of a subject or what he asked many questions.

Link to comment
Share on other sites

nod.  thx for the info, Dad72.  Maybe he tried to do painting on dynamic textures, and went crazy.  :)

 

You did some experimenting with texture painting, too, right?  Were you using planes and heightmaps, mostly?  Got advice?  Test playgrounds/scenes? (thx) 

 

I think DBawel is going to try some on-mesh texture painting, soon.  I decided to take a tour around the forum and see who had already tried it, and see if I could get DB some helpful hints. *shrug*  Did you try some custom brushes?   Did you try any "smear" brushes... that didn't apply color, but smudged and smeared colors that were already upon the texture?  Did you try any pattern/procedural fills?  How about using a small texture as a brush?  (thx for any info on all those things if you have some... I appreciate it much!)  Hope you're well!

Link to comment
Share on other sites

Hello Wingunt,

 

I managed to do what I wanted "approximately", this can probably be improved in the future, but it works.
For examples, I think you can figure out how I did on my CastorEngine editor.
 
here: (It's the graphics that displays the tools to paint or sculpt ground: planes or/and heightmaps)
 
and here: It's all part of the process. it starts line 200 for paint and line up 345 (probably the part that will interest you the most ;) )
 
PS: the function resizeImage is unnecessary and will be deleted soon, do not take this into account this function  :wacko:
 
If not in this, there are examples on the playground.
 
I'm fine, yes, I hope you do too.  :)

 

 

Link to comment
Share on other sites

Wow!  Thanks D72!  There is a mega-ton of useful things in there.  Can you keep that code at those urls... for...  10 years or so?  :)

 

Thanks for the "stuff", and for showing me the exact code lines.  Excellent.  You used a canvas as a brush.  Interesting.  No-mesh decals!  Compositing?  Maybe that's the correct term... maybe not.  Lots of hours of work in there, eh D?  *nod*

 

I imagine that zooming/unzooming is real important for texture painting.  And creating all the basic brush shapes... soft edge, hard edge, phew.  I guess that's why Corel and Adobe have so many employees.

 

Thanks again. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...