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 / Spherical Coordinates and Normal Mapping.

Author
Message
Programmer X
18
Years of Service
User Offline
Joined: 14th Nov 2007
Location:
Posted: 24th May 2013 07:56 Edited at: 11th Jun 2013 22:39





Remstart

The Above is my issue it doesn\'t work it\'s to take advantage of the Fact that the Cross Product of Two Phi components are perpendicular to the Phi Plane so Phi is based on one variable.

The Below Works and calculates a Normal Map. Any Advice???

Remend




XXX
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 24th May 2013 17:12
Please use code tags, and explain why you have posted this code.

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Programmer X
18
Years of Service
User Offline
Joined: 14th Nov 2007
Location:
Posted: 24th May 2013 22:23


Ok Something was wrong with the Dot Product but now it's giving concentric circles on the normal map any ideas?

XXX
Programmer X
18
Years of Service
User Offline
Joined: 14th Nov 2007
Location:
Posted: 24th May 2013 22:27
NVM i think i got it it should be set to 256 instead of 128 when >256

XXX
Programmer X
18
Years of Service
User Offline
Joined: 14th Nov 2007
Location:
Posted: 24th May 2013 22:35
NVM its still an issue caused by division by zero any advice on how to handle this?

XXX
Programmer X
18
Years of Service
User Offline
Joined: 14th Nov 2007
Location:
Posted: 26th May 2013 21:55
I think I made a Mistake Cross Product Phi may need to be set to

CrossProductPhi(PC,VG,0)=INT(256.0/64*(256-((PC+VG)/2)))
CrossProductPhi(PC,VG,1)=INT(256.0/64*(256-((PC+VG+256)/2)))
and use if statements based on which quadrant its in(they may be right though)

XXX
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 27th May 2013 00:00
Please edit your first post using code tags - and explain why you posted that code. [You've already been asked to do this. ]
Burning Feet Man
18
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 27th May 2013 01:12
I do believe the answer is 42, that is of course, if you were to actually ask a question.

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
Programmer X
18
Years of Service
User Offline
Joined: 14th Nov 2007
Location:
Posted: 4th Jun 2013 02:36
What Are Code Tags? I added comments in REM if that's what you Mean

This code however just exits and I'm not sure why any advice?



XXX
thenerd
17
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 4th Jun 2013 05:02
he's talking about the code box that you've just used. the code in your original post is causing the page to be stretched and it's hard to read.

Programmer X
18
Years of Service
User Offline
Joined: 14th Nov 2007
Location:
Posted: 7th Jun 2013 00:30


Does anyone know why this won't even run in Dark Basic Pro

XXX
paul5147
20
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 7th Jun 2013 08:11
You cant define constants twice,remove the second "def" declaration and it compiles fine
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 7th Jun 2013 10:53
You also don't need to Global Dim arrays. They're global by default.

This is my current project, check it out! [href]forum.thegamecreators.com/?m=forum_view&t=204576&b=8[/href]
This is my website, check it out! [href]http:\\www.TeamDefiant.co.uk[/href]
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 8th Jun 2013 01:14
It's not compiling because you're an idiot.


Yesterday is History, Tomorrow is a Mystery, but Today is a Gift. That is why it is called "present".
Mage
Valued Member
19
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 8th Jun 2013 03:11


Programmer X
18
Years of Service
User Offline
Joined: 14th Nov 2007
Location:
Posted: 11th Jun 2013 10:53
Rem Project: Online Normal Map
Rem Created: Monday, June 10, 2013

Rem ***** Main Source File *****



I finally got it to work decently

XXX
Programmer X
18
Years of Service
User Offline
Joined: 14th Nov 2007
Location:
Posted: 11th Jun 2013 11:36 Edited at: 11th Jun 2013 22:41


This should give you a better view:
if you look closely you can watch the dark sections grow and shrink as the Angle changes.

XXX
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 11th Jun 2013 13:18
It would be much better still if you attached that code to your post as a file. Use the Browse button.
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 11th Jun 2013 18:13
Please stop spamming...

This is my current project, check it out! [href]forum.thegamecreators.com/?m=forum_view&t=204576&b=8[/href]
This is my website, check it out! [href]http:\\www.TeamDefiant.co.uk[/href]
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 13th Jun 2013 13:45
I'll say this only once:

Quote: "It would be much better still if you attached that code to your post as a file. Use the Browse button."


It is extremely difficult to accurately copy and paste long code from a code box. Please use a file attachment.

[I think I said it twice ... or three times in total.]
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 23rd Jun 2013 04:06
Hey Programmer X

I may have figured out a better way to TEV. Check this out.



TheComet

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 23rd Jun 2013 04:24
Quote: "I may have figured out a better way to TEV. Check this out."


WHAT THE H...!!! Nice Code Snippet.

I'm not a grumpy grandpa
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 23rd Jun 2013 13:54
Damnit!!!

lol

This is my current project, check it out! [href]forum.thegamecreators.com/?m=forum_view&t=204576&b=8[/href]
This is my website, check it out! [href]http:\\www.TeamDefiant.co.uk[/href]
Brendy boy
20
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 23rd Jun 2013 17:35
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 23rd Jun 2013 22:04
I like it.

[Offtopic] Why do I get logged out of the forum when I visit the TGC Home Page? Happens with IE on both Vista and W7. It's been happening for a while, a few months perhaps. [/Offtopic]
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 23rd Jun 2013 22:24
Quote: " Why do I get logged out of the forum when I visit the TGC Home Page?"


I suppose there must be a link instead a code snippet...something like this:

Quote: "***
***"


not sure

I'm not a grumpy grandpa
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 24th Jun 2013 12:49 Edited at: 24th Jun 2013 12:51
Correction:

Quote: "Why do I sometimes get logged out of the forum when I visit the TGC Home Page? Happens with IE on both Vista and W7. It's been happening for a while, a few months perhaps."


Just checked - worked OK today when I hit the forum Home button.

Edit Inserted correct link. [Is it Monday morning already?]

Login to post a reply

Server time is: 2026-07-07 06:01:53
Your offset time is: 2026-07-07 06:01:53