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 / 3D space back to front?

Author
Message
Ramus73
14
Years of Service
User Offline
Joined: 24th May 2009
Location:
Posted: 8th Feb 2016 19:16
Hi guys. I have been using DBP for years now and I have always worked around this issue but now I need everything orderly. The issue is if I place a PLANE object and do not rotate it or change it in any way any texture I place onto it is mirrored? If I position the camera facing the texture the X co-ordinates are back to front? (ie moving the object left makes it move right across the screen). The other side of the object is transparent due to culling so are the normals facing the wrong way or the camera?
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 8th Feb 2016 22:49 Edited at: 8th Feb 2016 22:53
The normals of a plane are reversed for reflection shading. However, setting the orientation flag in the Make Object Plane function will correct this.
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 9th Feb 2016 03:23 Edited at: 9th Feb 2016 03:39
After a little more research, it appears this has nothing to do with reflection shading. Lee just wrote the function wrong. Instead of correcting it, the orientation flag was added in version 7.0.
Ramus73
14
Years of Service
User Offline
Joined: 24th May 2009
Location:
Posted: 16th Feb 2016 16:32
Thanks WickedX I did not know there was an orientation flag on the Make command. If I had read the description of the Make Object Plane command I would have noticed this sentence- 'Be aware that the default orientation of the plane is reversed'. Lol
Ramus73
14
Years of Service
User Offline
Joined: 24th May 2009
Location:
Posted: 16th Feb 2016 16:54
Ok I have just added the orientation flag and now the Plane disappears completely, I have to change the Cull value to 0 to see it from the other side and the texture is still mirrored?? Am I missing something or are the planes orientation values a complete mess?
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 16th Feb 2016 17:44 Edited at: 16th Feb 2016 17:50
This is because you either had to rotate the plane or the camera by 180 degrees.
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 16th Feb 2016 17:58
Maybe a little explanation of the plane function will help. A plane without the orientation flag set is created with the normals reversed and rotated on the y axis by 180 degrees. With the orientation flag set it is created with correct normals and no rotation.

Login to post a reply

Server time is: 2024-04-23 10:07:08
Your offset time is: 2024-04-23 10:07:08