Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Set Point Light VS Position Light

Author
Message
JackDawson
12
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 14th Sep 2011 23:39
These two are listed in the help. But they are vague in their descriptions.

set point light 0,0,0,500
position light 0,0,100,0

What i'm trying to understand is what the two differences are. Why would you use Set Point Light if you already have light. Or does Light, get set to point to a spot in space ?

Create Light 0 then position it somewhere. Then have set point light to point the direction of Light 0 ?

"Life is like a box of chocolates.. eat it before it melts."
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 14th Sep 2011 23:45
I've always assumed light 0 is the ambient scene light.

Warning! May contain Nuts!
Rich Dersheimer
AGK Developer
14
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 15th Sep 2011 00:16
Lights come in different types, point, directional, spot. Ambient light is just general light.

Look at the help files a little more closely, you will get the difference between light types.

Setting a position for directional lighting has no real effect, only the direction of the light matters.

Setting a position for a point light DOES matter, the light rays goes out in all directions from the point.

For a spot light, position AND direction matter.

JackDawson
12
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 15th Sep 2011 00:17 Edited at: 15th Sep 2011 00:19
@ WLGfx - That is only how bright the environment is though. Not really has anything to do with Lights. What I am trying to get at is positions of each the Light and Point. Are they two separate things ? That's what I'm trying to find out. Because when I move the point, the light emanates from that position. When I get rid of light point, then Light emanates. So its confusing. In other words, if they both do the same thing, why have two of the same commands.

@ Rich Dersheimer -- Ahh, I didn't realize there was more then one light type. Thanks for the heads up.

"Life is like a box of chocolates.. eat it before it melts."
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 15th Sep 2011 00:24
Both commands position an existing light. Set point light, changes an existing light to a type of light called a point light. A point light is basically a spot light as opposed to omni directional light shinning in all directions.


Ambient light and light 0 are not the same. You do not need to create light 0, it is always there. You can hide light 0 if you do not want it to affect the scene or change it to a different type of light. If you set ambient light to 0 but don’t hide light 0 your scene will still be lit by light 0.

[img][/img]


WindowsXP SP1,Vista,Windows 7 DBpro v7.61
Stab In The Dark Editor
The coffee is lovely dark and deep,and I have code to write before I sleep.
Rich Dersheimer
AGK Developer
14
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 15th Sep 2011 00:36 Edited at: 15th Sep 2011 00:41
Quote: "A point light is basically a spot light as opposed to omni directional light shinning in all directions."


Well, no. A point light exists at one point in 3D space and shines in all directions from that point.

A spot light exists at one point in 3D space and shines in only one direction, spreading out in a cone as it gets farther away from that point.

Here is a point light, at 0,0,0, shining on two spheres. A spot light will only illuminate what it is pointed at. A spot light at 0,0,0, pointed at the left sphere, will never illuminate the right sphere.



Directional light has no position, only a direction. Light zero starts as a directional light, but may be changed to a spot or point light.

Attachments

Login to view attachments
JackDawson
12
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 15th Sep 2011 01:24 Edited at: 15th Sep 2011 01:38
Ok here is one for you then.. which lighting setup would I use to light up a matrix terrain ? I can see that it lights it up, but what its doing is light everything on all sides within a range. Instead of creating shadows on the sides of the matrix that is not being seen from the light. See the problem ?

I do not have my terrain set as an object. I want it to stay as a Matrix.


Here is an example picture of one side of the mountain still in shadows because the light is not touching it.



"Life is like a box of chocolates.. eat it before it melts."

Attachments

Login to view attachments
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 15th Sep 2011 01:26
When you turn the ambient light down, you can see the real lights more clearly.

JackDawson
12
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 15th Sep 2011 01:28
Pincho, scroll up. You'll see the picture I just put up.

"Life is like a box of chocolates.. eat it before it melts."
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 15th Sep 2011 01:31
That's what I meant. You get that with the ambient light turned down. Of course you then also have to get the lighting setup properly as well.

JackDawson
12
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 15th Sep 2011 01:33
Yea I tried all that. Doesn't work as a shadow on the matrix. Your probably still referring to the Terrain as an object. Mine is not an object. I created a Matrix Terrain, not an Object Terrain. There is a difference between the two.

"Life is like a box of chocolates.. eat it before it melts."
Rich Dersheimer
AGK Developer
14
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 15th Sep 2011 01:41
So your example image is what you want to see, not what you ARE seeing?

JackDawson
12
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 15th Sep 2011 01:45 Edited at: 15th Sep 2011 01:46
That image is an example off of another game.. not my game. I put that there to show what I am trying to accomplish as far as shadows are concerned.

And that is correct. I am not seeing shadows on the matrix terrain unless it's outside of the range of the light.

"Life is like a box of chocolates.. eat it before it melts."
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 15th Sep 2011 01:55
What sort of light do you want? For an outdoor scene you'd usually want ambient light and a directional light. The directional light would represent distant light sources such as the moon or sun and the ambient light would represent the general level of light that gets bounced off various surfaces and illuminates everything. Fancy game engines use more complicated versions of ambient light so that corners of rooms, alcoves, etc, get less ambient light.

I wasn't aware that matrix terrains needed special consideration with lights - but they might. I use objects myself.
JackDawson
12
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 15th Sep 2011 02:05 Edited at: 15th Sep 2011 02:36
Quote: "The directional light would represent distant light sources such as the moon or sun and the ambient light would represent the general level of light that gets bounced off various surfaces and illuminates everything."


I am well aware of this fact. Its what I'm trying to accomplish with my Matrix Terrain.

Quote: "I wasn't aware that matrix terrains needed special consideration with lights - but they might. I use objects myself."


Yes Matrix reacts differently to lighting then objects do. Its a problem I have read over and over when I run a search..


I have attached code to give you an idea of what i'm talking about. Look at where the shadows are. They only start to appear as the Light range is further out. But if you notice, the hills are not casting shadows based off the light position.

I put two spheres to represent where both the light and the point light are set. There is two spheres, both in one spot. So you will only see 1 sphere.

If you notice, with objects you can cast shadows with it by using the "set shadow shading on ( you obj Number)" and then you will see the shadows on your matrix. BUT.. having the matrix itself cast shadows back on itself will not work. That's why the hills are not casting shadows. I am asking if there is a command I am missing that will work with Matrix in general. I do not want to have to convert it to an object. An idea I am looking for is "set shadow shading on matrix ( your matrix number )" or something like that.

Here is an example of Objects casting shadows ONTO the matrix. So that part works.



But the Matrix itself will not cast shadows onto itself. And that is what I am trying to do like in the other picture example above. And even in this example, you can see the the parts of this matrix terrain that is pointing away from the light, is still lit up the same brightness as the ones facing the light source.

EDIT : By the way, before anyone says to search.. I already did and these are the only two links that came up. And neither one was answered.

Searching for "Matrix Light" in the DBP Forums.

http://forum.thegamecreators.com/?m=forum_view&t=143618&b=1

http://forum.thegamecreators.com/?m=forum_view&t=123250&b=1

"Life is like a box of chocolates.. eat it before it melts."

Attachments

Login to view attachments
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 15th Sep 2011 02:38
I couldn't see any shadows - and I could only see what the light was doing by making it much closer to the player/camera. It certainly didn't seem to be consistent with a light range of 10000 units.

I don't have time to look closer at your code now - it takes a long time to wade through your code to find all the bits that might affect the lighting and I might have missed something important .

Have you tried using a simple directional light without the various shadow commands. They seem to interfere with lighting in my experience.

Perhaps you need to use light 1 rather than light 0?
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 15th Sep 2011 02:46
Just seen your edit. For some reason I don't see a clearly lit scene like that. Which upgrade are you using? I probably need to be using the same version as we discussed the other day I suspect. I'll try to find time to look at this again tomorrow - but I'm afraid I don't know of any special matrix lighting/shadowing commands. The terrain in your screenshot is obviously being affected by lighting in some way. It might be simpler to start from that demo since things there seem to be working. Which version was it? I've probably still got the download (plus several others ).
JackDawson
12
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 15th Sep 2011 02:51 Edited at: 15th Sep 2011 03:49
I uploaded the code I am working with. You can just add a cube and set the shading on it. You'll see the shadows from it on the terrain. And you can also see the shadows of the Sphere in the water too.

But.. I am wondering.. As I look into that 2nd link much more closely, Mugen posted some code that I have been trying to examine. ( I hate GOTO and GOSUB commands. ) Somehow, HIS CODE has the shading with the matrix. But there was no explanation as to how he is doing it. I am looking at his code and from what I can see, this command "SET MATRIX NORMAL Matrix Number, TileX, TileZ, NX, NY, NZ" might have something to do with it. I could be wrong on that. But the help file explains it this way :

Quote: "The normal is a projected direction away from the vertex position that instructs the matrix how to take light for that point. You can use matrix normals to affect how the matrix is lit and at what strength. The matrix number and tile reference values should be integer values. The normal values should be real numbers."


I believe this is what I am looking for.. but I need to figure out how to implement it. I'll let you know once I figure it out.

EDIT : Ok, this is what I am testing so far. and it DOES effect the brightness of the matrix.



I updated my Code Snippet here to reflect what I'm doing so far.

What I am trying to do now, is figure out a way to know the direction of the point. If its pointing away from the light or toward the light. Once I figure that out, then I can know what do with the above function.

Right now, this : nx# = SunxPos : ny# = (sin(SunyPos)+1.0)/2.0 : nz# = SunzPos is wrong. But I put it there for now. It would not be based off the sun's X Y AND Z literal coordinates. It would however be based on which X and Z direction though. And then combined with Height of the sun. So this is some tricky math here.

I figure if I can base my point of tile to get brightness, I need to know if its facing the X and Z of the sun. If it is not, then I would need to know the Height of the sun to determine brightness. With those three, I then would calculate how much brightness is to be put onto that tile of the matrix.

"Life is like a box of chocolates.. eat it before it melts."
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 15th Sep 2011 13:06 Edited at: 15th Sep 2011 18:01
Quote: "I am looking at his code and from what I can see, this command "SET MATRIX NORMAL Matrix Number, TileX, TileZ, NX, NY, NZ" might have something to do with it."


I haven't used that command but it definitely sounds like what you need. DBPro will use that information to calculate the brightness.

The normal vector is the direction which is perpendicular to, and pointing away from, the surface. So, for example, a horizontal surface would have (Nx, Ny, Nz) = (0, 1, 0) and one tilted at an angle of 45 degrees around the z axis would have a normal vector (Nx, Ny, Nz) = (-0.707107, 0.707107, 0). This has nothing to do with the position of the light and is a property of your geometry. You can calculate the normal vector from the heights of three neighbouring points as long as they are not collinear. The best way to do this would be to use vector3s with the 3D maths commands.

Here's a simple demo:



As long as your surface doesn't have vertical faces that should work. If it does, i.e. with Ny = 0, you need to do a bit more checking to make sure the vector faces the right way.

Edit Added first few lines of snippet left off by mistake.
JackDawson
12
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 15th Sep 2011 15:18
Quote: "This has nothing to do with the position of the light and is a property of your geometry."


Uhmm ok.. now I'm confused. How would it know if its to be a darker shade or not in reference to the position of the sun ( light )?

The demo doesn't work by the way.

Quote: "Right now, this : nx# = SunxPos : ny# = (sin(SunyPos)+1.0)/2.0 : nz# = SunzPos is wrong. But I put it there for now."


I did post that in my message, I had only put Sun(xyz)Pos in there for now as a place holder. But I would need to understand how to use your Vector3 info I guess. But I would still think I would need to know from which direction the light is coming from to know where to put the shadier side of the hill on. I'll look more into Vector3 and see what I can find out.

Thanks for the help GG.

"Life is like a box of chocolates.. eat it before it melts."
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 15th Sep 2011 18:00
Quote: "But I would still think I would need to know from which direction the light is coming from to know where to put the shadier side of the hill on."


I'm not sure I understand what you're trying to do. DBPro calculates the shading itself using the normals and lights. Why do you need to worry about the details?

Quote: "The demo doesn't work by the way."


Oops. Looks I didn't copy the first two lines. I've added those now.
JackDawson
12
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 15th Sep 2011 19:38 Edited at: 15th Sep 2011 19:55
Quote: "I'm not sure I understand what you're trying to do. DBPro calculates the shading itself using the normals and lights. Why do you need to worry about the details?"


Maybe there is a misunderstanding here. I am trying to add shadows to my terrain in real time as the sun moves. The shadows from objects work. But the shadows from the terrain itself does not work. The Matrix does not shadow itself, like you see in the example pictures above. Objects can cast shadows onto a Matrix terrain, but again, the matrix itself cannot cast a shadow onto its own self.

So, I have to determine the direction of the sunlight and cast the shadow on the vertices that are NOT facing the sun. Meaning if the vertice is facing west, and the sun is in the east, then the vertice ( or texture on it ) would be darker in color.

So I have to determine not only the direction its facing, but also the direction of where the light source is coming from.

There is little info on this forum about lighting a Matrix which is probably why people use objects for their terrain. But I want to use a Matrix Terrain instead of making an Object terrain. And the commands your speaking of work great with objects, but there is little to no info on how to do this for a Matrix Terrain.

In other words, I am having to Manually figure out the math / source code, since no one has shown a simple way to do this in DBP with a command.

EDIT : From another thread.
@ WLGfx :
Quote: "Yeah, so far I've been using the built in "Set Object Normals objID" with auto calcs an objects normals but to do it manually on a matrix you'd have to look into working out the orientation of the face. I had a look a while ago but found I didn't need to because of DBP's built in command. If I spot it again I'll post it here for you man..."


Your stating an object. The terrain info I am speaking about is not an object, its a terrain made from making a Matrix. So yes I would like to see that command you come up with. Just giving you a heads up here.

"Life is like a box of chocolates.. eat it before it melts."
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 15th Sep 2011 22:12
I'm sure that terrains self shadow. I did a search, and didn't really find many people who had problems. This link...

http://forum.thegamecreators.com/?m=forum_view&t=185655&b=8

He has the shadows working from the start, even before the coding has really started. The only problem I read about was somebody using 16 bit textures. They didn't shadow.

JackDawson
12
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 15th Sep 2011 22:52 Edited at: 15th Sep 2011 22:57
Quote: "I'm sure that terrains self shadow. I did a search, and didn't really find many people who had problems."


If you did a search and others are not having problems, please show me links that have source code to show me how they got it to work.

The link you shown me, all that did was show me a project he is working on, but there was no source code to see how he did it.

So far, no one has been able to show proof that this can happen without a lot of math usage. ( Except Mugan who had source code, but he didn't explain how he did it either, so there was no way to know what he was doing since he used nothing but GOSUBS through-out his whole code. ) There are No DB Commands for this like there is for objects. Sad really. Objects can self shadow, but matrix can not.

"Life is like a box of chocolates.. eat it before it melts."
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 15th Sep 2011 22:57 Edited at: 15th Sep 2011 22:58
I don't think you have to do anything, they just work on their own. It is the opposite with your project.. something is stopping it from working.

JackDawson
12
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 15th Sep 2011 22:57 Edited at: 15th Sep 2011 23:29
No they don't. If they did I would not be putting this thread here. Again, so far, no one has been able to prove it. They say it does, but no proof when I am showing proof that it does not.

This is GG's words :
Quote: "I couldn't see any shadows - and I could only see what the light was doing by making it much closer to the player/camera. It certainly didn't seem to be consistent with a light range of 10000 units."


Even he is baffled by it.


EDIT : Interesting info here. WLGfx and I have been conversing and it seems that I might not be normalizing my matrix. I'll give you a heads up once I check into this.

"Life is like a box of chocolates.. eat it before it melts."
petethesparky
13
Years of Service
User Offline
Joined: 18th Mar 2011
Location:
Posted: 15th Sep 2011 23:53 Edited at: 16th Sep 2011 00:03
Hi, I'm the guy that is doing the EasyMatrix program that you have been linked to.

I didn't do anything special to get the lighting to shadow like that, it's pretty much automatic. All I did really was turn off the generic area lighting, and create a light which is attached to the selector rod thing. These two lines turn off the generic light, and create a new light...



The only other "lighting" code is the line that makes "light 1" follow the selector rod, which is this...



When I created "light 1", I didn't set it as a spot light, or a point light, or anything. It's just the default "make light" command.

I don't think this will help you much, but it's all I did. I haven't done anything special to the matrix properties either, it's just a standard "make matrix" command.

EDIT: By the way, I'm using an nVidia GeForce GTX560Ti card. Perhaps it's your graphics card rather than your code that is throwing you? Having said that, EasyMatrix looks exactly the same on my old 8800GT.

WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 16th Sep 2011 01:01 Edited at: 16th Sep 2011 01:10
I knew I'd seen it before:

http://gmc.yoyogames.com/index.php?showtopic=374068

How to calculate a face normal without using the slow vector3 things.



This was the original doc I read: http://fullonsoftware.co.uk/snippets/content/Math_-_Calculating_Face_Normals.pdf

Warning! May contain Nuts!
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 16th Sep 2011 01:41 Edited at: 16th Sep 2011 02:00
I had a look into what petethesparky mentioned and tried it. Hiding light zero does have an impact and it seems the normals are set on the matrix. Still a little more experimenting to fully test this though.



The light works on the matrix fine without me even calculating the normals so far. I commented out the set matrix normal command, I originally put that in as a default normal pointing upwards.

As soon as I've fiddled a bit more I'll post some more but I think at the moment the normals are correct.

EDIT: Try this now with your code, it calculates the normals and still seems to work correctly with lighting.



I almost wrote out another post...

Warning! May contain Nuts!
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 16th Sep 2011 02:02
Here's a simple demo using the calculation I gave you earlier but applied to a matrix. The calculation could be improved somewhat but shouldshow you the basic idea. [Incidentally I still think you are talking about shading not shadows. Surfaces can still be in shadow even if they face the light.] Just use your own texture in the demo.



I really don't know why you are all making such a meal of this.

Quote: "The light works on the matrix fine without me even calculating the normals so far. I commented out the set matrix normal command, I originally put that in as a default normal pointing upwards."


I think that is the DBPro default for matrix terrains anyway so you'd see something with a point or spot light but probably not with a directional light since all points would be lit the same.
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 16th Sep 2011 02:05
Quote: "I really don't know why you are all making such a meal of this."


It's something I'll definitely need in the very near future so I was determined to figure it out. I've got a few more ideas up my sleeve so my next thing will be averaging vertex normals next for more complex procedural model creation I'm working on.

Warning! May contain Nuts!
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 16th Sep 2011 02:12 Edited at: 16th Sep 2011 02:12
That wasn't what I meant.

I was referring to the persistent confusion between shadowing and shading - and to the misunderstandings about how lighting works.
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 16th Sep 2011 03:04
Don’t forget to calculate the ABBY NORMALS.LOL


[img][/img]


WindowsXP SP1,Vista,Windows 7 DBpro v7.61
Stab In The Dark Editor
The coffee is lovely dark and deep,and I have code to write before I sleep.
JackDawson
12
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 16th Sep 2011 03:15
@ petethesparky Hey thanks for trying bro. Yea I didn't see the shadows work correctly in your video either. But I wanted to see if it was just me not seeing it in the video before I said anything. Anyhow thanks for trying.


@ WLGfx Thanks bro, i'll check out the code and get back to ya.

Quote: "I was referring to the persistent confusion between shadowing and shading - and to the misunderstandings about how lighting works. "


@ GG The confusion was that there is no way to know HOW shadows was being formed. A light casts shadows on an object, so how were we to know any other way. I'll check out what you gave out here and I'll get back to you.

Either way, thank you guys for your help on this. Hopefully we can get this working in the near future.

"Life is like a box of chocolates.. eat it before it melts."
darkvee
18
Years of Service
User Offline
Joined: 18th Nov 2005
Location:
Posted: 16th Sep 2011 05:55 Edited at: 16th Sep 2011 05:58
Hi JackDawson

Here is normals working on the matrix using Green Gandalf example with a rotating light.


darkvee
JackDawson
12
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 16th Sep 2011 09:53 Edited at: 16th Sep 2011 10:52
Well I took a break from all this to have a fresh perspective. I think I was getting stressed out because I have a hard time articulating what I am trying to do. BUT.. with that said.

GG and darkvee, I combined both your code and had the light rotate around the terrain. And I have to say, WOW.

This function, is WHAT I was trying to figure out and you guys got it right on the nail. I knew WHAT I was after, but explaining is not always the best and it gets frustrating.



I'll work on seeing how I can impliment this into my source code. But in the meantime, here is a picture of what I did with both of your code combined.

Thank you guys.. ALL OF YOU. The more you push me to explain, the more its forcing me to keep going forward on this. Again, thank you to all.

EDIT : You can now get the latest version of my Active Terrain ( with source ) from my original thread.

http://forum.thegamecreators.com/?m=forum_view&t=188775&b=1



"Life is like a box of chocolates.. eat it before it melts."

Attachments

Login to view attachments
darkvee
18
Years of Service
User Offline
Joined: 18th Nov 2005
Location:
Posted: 16th Sep 2011 11:46 Edited at: 16th Sep 2011 12:33
Your Welcome JackDawson glad we could help.

That looks really nice. Look what I did. Now the matrix can receive a heightmap.


Here is a screenshot of it


darkvee
JackDawson
12
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 16th Sep 2011 19:19
Excellent code there Darkvee. Yea I am using something similar to that idea in my code that you can download from my thread. Good job !!

"Life is like a box of chocolates.. eat it before it melts."
darkvee
18
Years of Service
User Offline
Joined: 18th Nov 2005
Location:
Posted: 17th Sep 2011 05:20
Thanks JackDawson

darkvee
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 18th Sep 2011 17:46
JackDawson

Glad everything seems to be working now.

That code I posted was rather hastily thrown together to show the basic idea and it could be improved somewhat. When you've got other things sorted out remind me to take another look (assuming you're still using my snippet of course). I won't be able to do much before mid October though.

There's plenty of others who can help out though.
JackDawson
12
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 18th Sep 2011 20:01
@ GG, yea I only used that one function. The rest of your code I didn't need. That function is what I was looking to use. It helps a lot. Thanks for that. Also its in my latest update so you can see the shadows now.

"Life is like a box of chocolates.. eat it before it melts."
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 18th Sep 2011 21:17
OK. When I get some time I'll post a better version. That should work fine for now - except possibly on some of the edges.
gwheycs62egydws
14
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 27th Dec 2011 04:34
hey

nice option

to move side ways - is to move forward
Since a Strait line gets thin fast

Login to post a reply

Server time is: 2024-05-17 13:07:10
Your offset time is: 2024-05-17 13:07:10