Jump to content

The Wingnut Chronicles


Wingnut
 Share

Recommended Posts

Hey Wingnut, You're also not the only one in states, I live in Ohio. 

 

On your Color3 issue I actually ran into that as well while screwing around... While I know its not suppose to be like that but found it odd.

 

I have started using the below, so I can use the normal R,G,B numbers.

 scene.clearColor = new BABYLON.Color3(92/255,148/255,252/255);

Link to comment
Share on other sites

Hi Xanmia!  Alright!  OHIO!!!  GOTTA LOVE IT!!  And thanks for the RGB hack... interesting.  Great to have you aboard/nearby!  Hell, I can pee from here to Ohio!  Not that I would.  You probably have plenty of pee there already, eh?  :)

 

I made an update to my light post...  I'll repeat it here.

 

Update:  Ok, it is BECAUSE the hemisphericLight.intensity is set to .1 (low)... that it takes Color3(0,0,20) to get the blue to go full saturation/vivid.  I tested it with a light.intensity = .01, and now it takes Color3(0, 0, 200) to make the blue full vivid.  The values of material.diffuseColor Color3 settings, are dependent-upon/related-to the light.intensity.  Interesting!  If hemiLight.intensity = 1, it still takes material.diffuseColor of Color3(0,0,2) to make the blue be full vivid.

 

So... to get the box to be full-vivid blue...

 

if light.intensity = 1  ...material.diffuseColor needs to be Color3(0,0,2) or higher.

if light.intensity = .1  ...material.diffuseColor needs to be Color3(0,0,20) or higher.

if light.intensity = .01  ...material.diffuseColor needs to be Color3(0,0,200) or higher.

 

(That's for them friggin' Frenchies.  Ya gotta reword things about 6 different ways or else they don't understand ya.)  hehe

 

*scratch scratch*  :)   scene.clearColor - I haven't experimented with that property (or about 1000 others) yet.

 

Thanks for chiming-in, Xanmia!  Tell us about / show us your webGL projects.  I wanna steal all your code and models.  err... I mean, we would love to see them and hear about them.  :)  I see that both of you guys are at around 20 posts.  You guys have probably already told us about your projects.  I am SO behind on my forum reading... likely because I talk so much.

 

Notice how I've let my English go sloppy since you guys have come to visit?  :)  ol' deltakosh is probably saying "Let's not make a habit of that, Mister Wingnut"  hehe.

Link to comment
Share on other sites

For the light. I think that even if you turn 2, it will be equal to 1 or 20 = 1 and 200 = 1.  1.5 = 0.5.

 

I think when it is greater than 1, thas divides the whole number of ways has always have a value between 0 and 1.

 

It's like this that I see, but I may be mistaken.

Link to comment
Share on other sites

Hi Dad72, thx for the words.  This hemisphericLight is working fine at light.intensity = 65.  BRIGHT!

 

I stopped increasing at 65, because the canvas started smoking and the box started melting.  :)  I think vertex glue is only rated to about 300 kelvin.  Beyond that, boxes start turning into planes.  ;)  At 500 kelvin, the physics engine needs to have a fluid dynamics add-on.

 

Man, I'm being a goofball today, huh?

 

But seriously, there's no limits on anything... not light.intensity, not Color3 settings.  I love it!  As DK implied earlier...  checking for allowed ranges, limits, and other bad input data from user... takes precious processing time.  I think DK generally hands it off to the webGL interface as quickly as possible.  If we users want to feed dangerous things to the GPU, he lets us do it.  Why not?  Its part of the "mad scientist" fun!  :)

 

But what do I know besides how to talk and talk and talk...  and talk.

Link to comment
Share on other sites

haha, yeah, I am relatively new.  Been working with BabylonJS for about a month and a half now, prior to that I was working in Three.js. 

 

You can see a lot of my work on my site kraem.com, which I seem to do more work on my games / tests then I do on my own site... (I should probably do some work on it  :) )  I also use to do a lot on http://codepen.io/Xanmia/ but all of those are Three.js.

 

I am hoping to make a ton more and mainly games in BabylonJS, so far I am loving it and am impressed!

Link to comment
Share on other sites

@xanmia  WOW!!!  Fantastic stuff!  Holy crap!  You just became a BabylonJS superhero in MY book!  Nice work!  You certainly have done very well with BJS in a very short amount of time.  Amazing!  (droooooool)  You're a game-making monster!  Phew.

Link to comment
Share on other sites

@temechon and others... here is another zipped update to our vmirror series... where we were testing video textures reflecting in mirror material... http://urbanproductions.com/wingy/babylon/videotexture/vmirror05.zip

 

For those just joining us, Temechon and myself were having problems getting a video to display on a plane when the plane was rotated certain ways, and problems getting it displayed on certain sides of a box.  Well, thanks to a hint from deltakosh (DK)... we discovered that we did not have the plane and box properly lit (lighted).  videoTexture is a StandardMaterial... it needs to be lit with proper lights.

 

OR DOES IT?  I finally decided to read the materials tutorial, about StandardMaterial.emissiveColor.  "The color produced by the material itself".  oooooookay.  In 3DSMax materials, that is called self-illumination.

 

Self-illumination!?  Interesting.  Does that mean... it needs no light?  That's right!  In the beginner tutorials for BJS, it is stated that you must have at least one light in the scene.  But... not if you have .emissiveColor set for each of your meshes.

 

So, here we go.  Vmirror5.zip has no lights whatsoever.  Not one.  But I put an emissiveColor setting on the box where the videoTexture is displayed, and there we go... a tv set that actually produces its own light... just like a real one!  The little sphere and box beside the big tv box... are as dark as an episode of True Detective.  Yet the "tv box" plays the OGV video nice and bright... perfect... on all sides of the box.  WITHOUT A SINGLE LIGHT!!!

 

I think that is SO cool.  This darned framework keeps amazing me day after day, demo after demo, test after test.  Got a lighting shortage?  No electricity?  Just turn-on that mesh.material.emissiveColor = new BABYLON.Color3 (1,1,1) and party on!  Sweet!

 

PS: This is mostly for Firefox and maybe Google Chrome, as IE11 does not like OGV video at this time.  There are some other small video files/formats included in this zip. I think Temechon found that 'small.mp4' (included) worked cross-browser... for those who had codecs for mp4.

Link to comment
Share on other sites

Hi Wingnut, like Xanmia I've been around a couple of months And I have this work in progress - converting 7 pieces of VRML from 11 years ago to HTML5/WebGL (so far only 2 converted).

 

The Streets Of Whitechapel (and I got a little help from code Xanmia published)

 

When I was working with VRML, I knew people from Germany to Australia, Alaska to Argentina - so I'm quite used to very smart guys from faraway places ;-)

 

I had been working with the Unity Game Engine and had used their Web Player plugin to display content on a web page, but last fall Chrome announce that plugins support would end and there is a rumour around the Unity forums that their Web Player plugin would be replaced by HTML5/WebGL - so I'm getting a head start.

 

A Simple Unity Maze Game

 

A link posted on the cgcookie. com website to the game with comments - you will need to get the Unity plugin to actually play the gamefrom there.

 

Apart from that, I enjoy using Blender, but am not a good scripter (a bit of a drawback) - but am looking forward to participating on this forum (though perhaps not as often as you :D  ). Currently I'm working my way through the Babylon.js examples and tuts - trying to learn the things that are important to me (currently collisions as I would like to bring that maze game to WebGL).

 

cheers,gryff :)

Link to comment
Share on other sites

Gorgeous, gorgeous, gorgeous, gryff!  Stunning!  Great scene layout...  excellent artistry... smooth nav...  tasty! 

 

Yeah, as far as my posting, I am not normally this active.  I think someone slipped some magic mushrooms into my cornflakes this morning. :)

 

Man, you guys are good webGL dogs.  I'm glad you introduced yourself and chose BJS to power your fine artistry.  Welcome welcome welcome!  TOO COOL!

Link to comment
Share on other sites

Vmirror05 works fine for me :) Good job ! How about updating the tutorial on video textures to add the emissiveColor ? ;) ;)

 

 

 

Temechon (and his team) are willing to adjust the docs readily, and Temechon seems to be here for the long-term future.  He seems very solid and active.  I almost like him.  hehe.

 

Awwww thanks :)

Link to comment
Share on other sites

As I mentioned above :

 

there is a rumour around the Unity forums that their Web Player plugin would be replaced by HTML5/WebGL

 

 

 

More on that rumour here:

 

In collaboration with Mozilla, Unity will also support WebGL, a web format that makes it easier to create 3D images on web pages. Developers can get early access to Unity’s WebGL add-on to create interactive experiences for games that don’t require plug-ins when used with WebGL-compliant browsers. Madfinger Game’s Dead Trigger 2 game, pictured at top, runs on WebGL, and Unity will demonstrate it at its booth at the GDC in San Francisco this week.

 

 

Unity 5

 

Will be interesting to see how this develops.

 

cheers, gryff :)

Link to comment
Share on other sites

Hi gang.  gryff, thanks for the link to the video.  Looks pretty nice, huh? 

 

If I knew anything at all about Unity, I'd sure be glad to engage you in conversation about it.  Sorry, though.  You might want to start a new thread with an appropriate title to it.  That would probably draw a few more like minds.  Mostly, people visit this thread to watch me move baby toys around in my crib, dig in my diaper, and try to say grown-up words.  :)  I guess I have Kerbal Space Program laying around somewhere.  I think that's a Unity critter.  Pretty fun, but it gave me a tumor.  heh

 

I've been reading a bit about OpenGL... and comparing it to BabylonJS conventions... trying to learn how to speak more intelligently.  I am looking over http://www.ozone3d.net/tutorials/glsl_texturing_p08.php... seeing how others do "projectors".  At first I thought it was a lighting thing, but it seems to be more materials-based.  Us newbies tend to get stuck in the land of "real", and it doesn't help that I've spent some time on-stage and also doing TV production.  But 3D graphics don't have real photons... and so...  I need to shake-off some mental programming.

 

I burned a few brain cells in the world of VRML 1.0 and VRML 97, and in the EAI.  With this webGL stuff, I find myself still wiping up lots of drool, and I get over-excited about little things... pretty often.  Advanced topics like the Unity system and openGL games... is still far beyond my intelligence, unfortunately.  Don't let my lack of knowledge on your subject... slow you down, though.  Get out there on the main BJS forum and start some posts with titles inline with your interests.  I'm not saying you won't find people with similar interests in THIS thread, though.  You might.  I just wish I could be more knowledgeable in those subjects.  *shrug*.  Sorry.  Would a smutty joke help?  I have a few of those.  :o

Link to comment
Share on other sites

Thanks DK.  You're too kind to me.

 

If possible, please remember that I ... (and maybe Temechon too) THINK the framework's videoTexture still needs a vertical flip.  (rotation 180 degrees around X axis).  It might be wise to check the video on Flat 2009 and see if the ecran plane has been rotated in order to get upright video.

 

Here is a picture of what I (and maybe Temechon) see: 

 

(@Temechon, this is vmirror4... using a box tv, camera straight-on, no extra meshes.)

 

http://urbanproductions.com/wingy/babylon/misc/vidbox_and_mirror.jpg

Top box is normal, un-rotated, cam looking +z... video facing -z. Bottom box is a reflection.

 

Here is a picture of when a PLANE tv is used:

 

http://urbanproductions.com/wingy/babylon/misc/vidplane_and_mirror.jpg

Top plane is normal, un-rotated, cam looking +z... video facing -z.  Bottom plane is a reflection.

 

@DK ... If a fix is needed...  you know...  don't forget for next version, huh?  ;)  (thx)

 

There could easily be a Mister Wingnut mistake lurking here somewhere, of course.  :)

 

Yes, I know I can adjust it manually.  But we want the video to be correct... by BJS default, so users don't have to fuss with mapping... right?  You betcha.  You know that already.  (sorry)  You are the king of "keep it simple".  :)  PARTY ON!

Link to comment
Share on other sites

Well, now I have gone and done it.  I cracked the planet.  Way to go, Wingy!  :/

 

https://github.com/BabylonJS/Babylon.js/wiki/06-Lights has been created... using the data from http://blogs.msdn.com/b/eternalcoding/archive/2013/07/08/babylon-js-using-lights-in-your-babylon-js-game.aspx.

 

The old tutorial 6, which was just a redirect to msdn... is backed up fine, so it can easily be restored. If the change is kept, we should probably ponder relocating the pictures and updating the base urls to match the other tutorials.

 

I took a few liberties.  Admin, text-wranglers, adjust at will... or yell at me, and I will change it back to original.  There will be quite a few tweaks in the days to come, as I proofread and proofread and proofread it  (if its validated at all).  I don't know why tutorial 6 was at the msdn blog, but I saw no reason not to convert it to GitHub markdown and take it on home to mama.  :)  Hope everyone is well!

Link to comment
Share on other sites

Cool. Thanks for your tutorials revisions. However why can't we used more than four lights.

For example a village lighting by several floor lamp with spot, we cannot?
 
Oh and you being mislead you on isEnabled. It's setEnabled. IsEnabled verified if it is enable or not.

Activating/Deactivating Lights

Every light can be deactivated by setting its isEnabled property to false or boolean 0. 

 

Correct:

Every light can be deactivated by setting its setEnabled() property to false or boolean 0. 

 

 

Link to comment
Share on other sites

Good questions and comments, Dad72!  I will need to talk to DK about .isEnabled() and .setEnabled() functions/methods.  I will learn what the story is... about that.  Thanks for showing me that.  Yes, there is mislead there.  I just copied the msdn doc.  Apparently there have been changes since that was written.

 

You CAN have many many lights in a scene, but only 4 lights can affect a single material.  I will try to make that more clear.  This is also interesting... and i will need to learn more.

 

I like your example... one material for the ground of an entire town... with many street lights.

 

Keep in mind that this tutorial is still very new, and surely full of mistakes.  It might not even be accepted.  It still needs DK's approval.

 

Keep up the good work on pointing things out, though.  You fixed some bugs in MY projects by showing me .setEnabled().  Cool.

 

I think MAYBE change BJS framework... remove .isEnabled() AND remove .setEnabled(), and JUST use .enabled property ... maybe.  DK will probably say NO WAY, DUDE!  :)

Link to comment
Share on other sites

I think MAYBE change BJS framework... remove .isEnabled property AND remove .setEnabled() function, and JUST use .enabled ... maybe.  DK will probably say NO WAY, DUDE!  :)

 

I do not think we should remove them.
isEnabled can check the status. (getter)
setEnabled will change the status. (setter)
Link to comment
Share on other sites

For gets...

 

if (light.enabled) then {...}

 

Why do we need... if (light.isEnabled()) then {...}  ?

 

--------

 

For sets...

 

light.enabled = true;

 

Why do we need... light.setEnabled(true)  ?

 

Do you want light.hasIntensity property, too?  Or maybe light.hasIntensity() method ?

 

And light.setIntensity(.05)  ?

 

-------

 

I think setters, getters, isWhatever, and hasWhatever... should be minimized. 

 

But I'm not a professional programmer.  Inheritence is involved in this.  *shrug*

 

I saw some of this stuff in old-days MOO/MUD programming...

 

How about... if (object.hasOwnedProperty("intensity")) then {...}  

And... if (object.definesMethod("setIntensity")) then {..}

They were painful inheritence-based methods!  :)  OUCH!

 

Don't worry, Dad72.  light.setEnabled() and light.isEnabled() exist... for a reason.  They will likely stay.  I think it has to do with the fact that lights are children of node.

 

Take care.

Link to comment
Share on other sites

You might want to start a new thread with an appropriate title to it.

 

 

I was not trying to hijack your thread Wingnut - just seemed appropriate as it was partly how I ended up on this forum. :)

 

Anyway back to the recent posts on this thread - getting and setting. Is there info somewhere on what you can get and set - and the javascript syntax for doing these operations ?

 

I'm thinking of a couple of interactive situations:

 

1. Switching a light on off when you click on a switch

 

2. Changing a mesh's visibility, and perhaps collision status,  after it is clicked on - it gets added to an inventory so no longer is visible in the scene.

 

cheers, gryff :)

Link to comment
Share on other sites

Hi gryff!  Nah, I was not worried about a thread hijacking.  I just thought you might get lonely. :)  Maybe get some better conversation 'action' in other threads, because, lets face it... I am not all that bright.  hehe.  After seeing your modeling, hell, I don't think I'm qualified to even wash-out your paint brushes.  :)

 

On the other subject, have you seen the API docs?  http://doc.babylonjs.com . Pull open that 'Classes' pull-down menu.  Wow, huh? 

 

Its a VERY useful webpage... generated with SOME automation and SOME grueling manual markup.  Its pretty new.  Its still being tweaked... but you can take over the world with the information that can be found there.  I use it SUPER-often.

 

Yes, you can toggle a light on/off with light.setEnabled(1/0).  You can also set its .intensity = 0;  Did you read the new tutorial I just posted-about?  Its chocked-full of vitamins and minerals that will help you grow strong lights.  :)

 

Let's see... mesh visibility.  Let's look it up in the API documents...

 

http://doc.babylonjs.com/page.php?p=24643

 

First, lets click on 'Extends' so we can see what properties and methods might be inherited from the mesh class's parent...

 

It extends... the node class.  One of its methods/functions ...  setEnabled() ...  is pretty obvious.  Although I am not very experienced, I would say that mesh.setEnabled(true or false)... would be ONE way to do it.  But there's another.  Let's go BACK to the MESH class.

 

Scroll down in that right-side menu and notice the .isVisible property.  Looks like it takes a 1 or 0 boolean.  Scroll down a bit futher and notice the .visibility property... it takes a number.  I have never experimented with that, but experiment your brains out and see what blows up. You might want to start a thread called "The Gryff Chronicles" so you can show us your demented experiments and describe your explosions and meltdowns. :)

 

In the movie "This is Spinal Tap", the band's amplifier knobs went up to 11.  With BabylonJS knobs/settings, they could go up to 100000... who knows?  Sending demented values to the webGL interface and to your computer's GPU... is part of the fun, right?!  The worst that can happen is that you lose an eye, right?  :)  Experiment, experiment, experiment.  I LOVE experimenting!  Its always full of surprises.  Rules?  We don't need no schtinking rules.  hehe.

 

Notice that we did not need to visit the NODE class to find mesh.setEnabled.  It was hiding deep in the methods section of the MESH class, too.  But remember that the API docs is new and still being tweaked.  Take a look at the SpotLight class.  Notice it has no .setEnabled() or .isEnabled() functions listed... but it is supposed to, I think.  Notice that the EXTENDS choice is missing as well, so we don't even know that all lights extend LIGHT class.  Give us some time to get the docs all fixed up around here... it is a big job.  And please.... help in any way you can.  BabylonJS is an EXCELLENT framework.  It totally ROCKS!  Its well worth the effort to 'give back' in any way possible.

 

Collisions... I'm sure nearly anything can be done.  Look to the mesh class.  Visit https://github.com/BabylonJS/Babylon.js/wiki/Tutorials #9, #10, and #11.  All three are about different types of collisions.

 

And if there's a function or property that YOU think is needed, let someone know... by posting your idea on the forum.  As deltakosh says, "ANYONE can influence the framework".  He means it.  He will go halfway around the world on snowshoes... to make sure users can get done... what they need/want to get done.  But keep in mind that English is not his native language, so keep your questions basic, with lots of white space, and not too many questions in any single post.  Only I get to rattle-on aimlessly for hours and hours.  :)  Be good!

 

Update:  docs for SpotLight class has been updated a bit, and so I edited my statement above, because all 4 lights... extend light, not NODE.  But if you look at class LIGHT, it needs to have an 'extends' on it, too, telling that IT extends NODE (I think).   

Link to comment
Share on other sites

Yes, I've seen those pages - and have been using them to work on my little staircase problem (finally solved I think ;) )

 

Here is what I'm trying to do. I have created a scene - a darkened room and the player is wandering about - and finds a light switch and clicks on it (I can get the mesh for the switch using "pick()" ). Now I want to be able to modify the scene by enabling a light with something like "aLight.set enabled()".

 

I know for instance that I can animate meshes by creating keys and then running the animation with "scene.beginAnimation(parameters)". Just need the correct syntax for getting and setting values in an already created scene for other objects besides meshes.

 

cheers, gryff :)

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...