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.

Dark GDK / dbScaleObject() issue

Author
Message
s_i
10
Years of Service
User Offline
Joined: 23rd May 2009
Location: Russia
Posted: 7th Jun 2014 23:39 Edited at: 7th Jun 2014 23:44
I use 2D objects like this:


Now 2D objects lie in the plane of the axes XZ. When I need to change the size of these planar objects, I use


but this does not give right effect. Only this work right:


Why axis Y and Z in dbScaleObject() are reversed ??? ??? ???

I searched the source code and found this in the file CPositionC.cpp:

Everything looks correct. Maybe I'm looking for an error in the wrong file?
WickedX
10
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 8th Jun 2014 08:00 Edited at: 8th Jun 2014 08:02
Quote: "Why axis Y and Z in dbScaleObject() are reversed ??? ??? ???"


This code should demonstrate the reason.

s_i
10
Years of Service
User Offline
Joined: 23rd May 2009
Location: Russia
Posted: 8th Jun 2014 12:08
Yes, I understand. dbMakeObjectPlane() makes object in XY axis, and dbFixObjectPivot() does not change vertex data in mesh.

Many thanks!
WickedX
10
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 9th Jun 2014 20:59 Edited at: 9th Jun 2014 21:01
Got a little bored last night and decided to refresh myself on some of the internal 3D functions. So, I coded you a "dbMakeObjectGroundPlane" function.



From appearance I could tell there was something wrong with the "dbmakeObjectPlane" function. That’s the reason I added the orientation parameter to the variant function in the update (which is available in DBPro). After looking at the source I see the vertex winding is clockwise, which is correct. But the normal’s are pointing into the front facing direction instead of away, as they should. The uv coordinates are off too. I suppose if your looking at the back face it will look correct. But, if you set the object culling flag the object will disappear. Does anybody know of any possible reason it would be coded this way?
The Tall Man
5
Years of Service
User Offline
Joined: 16th Nov 2013
Location: Earth
Posted: 9th Jun 2014 21:08 Edited at: 9th Jun 2014 21:11
I don't know, I redid that plane creation function also in my own copy of the source code, making the same change with the normals. I also made it use 4 vertices instead of 6.

Judging what we see is the greatest blinder and self-limiter in the universe.

What we perceive is never reality. It is only a story we tell ourselves based on our current perspective, which has far more to do with our beliefs about ourselves than with anything else.
WickedX
10
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 9th Jun 2014 21:18
Quote: "I also made it use 4 vertices instead of 6."


That is how I coded the "dbMakeObjectGroundPlane" function.
The Tall Man
5
Years of Service
User Offline
Joined: 16th Nov 2013
Location: Earth
Posted: 9th Jun 2014 21:24
There is a comment somewhere in the source code that says its corresponding function can't handle triangle strips. I've never run into any problems though - probably not using that function.

Judging what we see is the greatest blinder and self-limiter in the universe.

What we perceive is never reality. It is only a story we tell ourselves based on our current perspective, which has far more to do with our beliefs about ourselves than with anything else.
WickedX
10
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 9th Jun 2014 21:46 Edited at: 9th Jun 2014 21:49
If you locate that comment again, let me know. I've searched and can't find it.

Edit: I think it may have to do with CSG.
The Tall Man
5
Years of Service
User Offline
Joined: 16th Nov 2013
Location: Earth
Posted: 9th Jun 2014 22:30 Edited at: 9th Jun 2014 22:32
Strange... I just did a search and can't find it either.


...Oh, here it is. I'd mentioned it in another thread at the time. Turns out it wasn't specific to triangle strips. You're right, it has to do with CSG.

It's in my last comment at the bottom, here:
http://forum.thegamecreators.com/?m=forum_view&t=208677&b=37

Judging what we see is the greatest blinder and self-limiter in the universe.

What we perceive is never reality. It is only a story we tell ourselves based on our current perspective, which has far more to do with our beliefs about ourselves than with anything else.
s_i
10
Years of Service
User Offline
Joined: 23rd May 2009
Location: Russia
Posted: 10th Jun 2014 23:16 Edited at: 10th Jun 2014 23:26
dbMakeObjectGroundPlane() -- tested!
Now after creating a square is no need to add these functions:

dbSetObjectLight (object, 0);
dbRotateObject (object, 90.0f, 0.0f, 180.0f);
dbFixObjectPivot (object);

Thanks again!

P.S. My & The Tall Man's code in "Code Snippet" box has no color, WickedX's code has color. How to do this trick?
The Tall Man
5
Years of Service
User Offline
Joined: 16th Nov 2013
Location: Earth
Posted: 11th Jun 2014 00:25 Edited at: 11th Jun 2014 00:58
About code highlighting:

http://forum.thegamecreators.com/?m=forum_view&t=211318&b=39

Judging what we see is the greatest blinder and self-limiter in the universe.

What we perceive is never reality. It is only a story we tell ourselves based on our current perspective, which has far more to do with our beliefs about ourselves than with anything else.
WickedX
10
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 11th Jun 2014 03:53 Edited at: 11th Jun 2014 08:23
Quote: "Now after creating a square is no need to add these functions:

dbSetObjectLight (object, 0);
dbRotateObject (object, 90.0f, 0.0f, 180.0f);
dbFixObjectPivot (object);"


The object is still affected by light and ambient light.

We have had code syntax highlighting for about five year's. We really need a sticky of all the forum tricks & tips.

Test: html escape codes work!
[code lang=cpp]source code[/code]

http://forum.thegamecreators.com/?m=forum_view&b=2&t=161402&p=0
The Tall Man
5
Years of Service
User Offline
Joined: 16th Nov 2013
Location: Earth
Posted: 11th Jun 2014 05:06
Hahaha! Wow! 'Cause it just came on in the other forum. They must be doing that one from scratch.

Judging what we see is the greatest blinder and self-limiter in the universe.

What we perceive is never reality. It is only a story we tell ourselves based on our current perspective, which has far more to do with our beliefs about ourselves than with anything else.
WickedX
10
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 11th Jun 2014 08:34 Edited at: 11th Jun 2014 22:40
Why would that forum need syntax highlighting? Doesn’t FPS Creator use FPI scripts? If we can program it in C++ then maybe I should look into getting Reloaded.
The Tall Man
5
Years of Service
User Offline
Joined: 16th Nov 2013
Location: Earth
Posted: 11th Jun 2014 09:07
No, Reloaded uses LUA scripts. No C++. They just have it and others enabled (and more user-friendly) in that forum for some reason.

Judging what we see is the greatest blinder and self-limiter in the universe.

What we perceive is never reality. It is only a story we tell ourselves based on our current perspective, which has far more to do with our beliefs about ourselves than with anything else.
s_i
10
Years of Service
User Offline
Joined: 23rd May 2009
Location: Russia
Posted: 11th Jun 2014 23:04 Edited at: 12th Jun 2014 00:02
TEST: language highlighting


Good, only the colors are pale.

Login to post a reply

Server time is: 2019-08-24 09:59:58
Your offset time is: 2019-08-24 09:59:58