Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,280 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Shader help #160112
10/10/07 06:45
10/10/07 06:45
Joined: Jul 2006
Posts: 503
Australia
A
adoado Offline OP

User
adoado  Offline OP

User
A

Joined: Jul 2006
Posts: 503
Australia
Hello all

I have just started to learn HLSL, so I am atm a shader noob

Imagine that there is a plane in 3dgs, at origin 0, and it extends to -4000 and 4000 on the x axis and -4000 and 4000 on the y axis (a square, large plane).

When a camera is above the plane, I want to get the camera's coordinates and convert them into the texture "space" ? of the plane, so the camera's position turns into the range 0 and 1 I think it is.

I am just having trouble getting the camera's position in world space into the range 0 and 1 for the shader's texture? (so later I can, for example, draw something under the camera on the plane)

Any ideas? Is this the best way to do it?

Thanks,
Adoado.


Visit our development blog: http://yellloh.com
Re: Shader help [Re: adoado] #160113
10/20/07 20:42
10/20/07 20:42
Joined: Oct 2007
Posts: 12
V
vin209 Offline
Newbie
vin209  Offline
Newbie
V

Joined: Oct 2007
Posts: 12
well being a noob myself i'm not quite sure what you're after but to me it seems alot like you are on about uv coordinates.

for example, using a program like maya you have to make sure your uv map is in the range of 0,1 in order for the texture you plonk on to come out correctly. you can then export that map to photoshop or similar to paint on a texture then take the whole thing to gamestudio.

i not completely sure but i dont think it matters about moving the camera in 3dgs at all as it wont affect the uv range, all it will do is make your square appear in the camera view with the texture visible at whatever resolution you have used. the uv range is something directly related to the uv's on the model and not the camera position, but hey i could be wrong...

just trying to help like

Re: Shader help [Re: vin209] #160114
10/21/07 01:33
10/21/07 01:33
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
Code:
x = camera.x/8000 + .5;
y = camera.y/8000 + .5;

surely that would do the trick?

hope this helps,

julz


Formerly known as JulzMighty.
I made KarBOOM!

Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1