Gamestudio Links
Zorro Links
Newest Posts
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
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,369 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Maths trig problem, angle to camera [Re: EvilSOB] #341539
09/17/10 20:43
09/17/10 20:43
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Still looking at it....


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Maths trig problem, angle to camera [Re: EvilSOB] #341540
09/17/10 20:45
09/17/10 20:45
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline OP
Serious User
MrGuest  Offline OP
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
lol, no prob mate, it's been pickling my brains all day.

Thanks for your time!

Re: Maths trig problem, angle to camera [Re: MrGuest] #341590
09/18/10 12:22
09/18/10 12:22
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
I give up... The trig is too evil for me...

Sorry dude... Bit I would try making them layer-entities, or
rotating them in MED.
But I dont know if thats useful 'deeper' into the project...

Maybe some trig-guru can help...


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Maths trig problem, angle to camera [Re: EvilSOB] #341595
09/18/10 13:18
09/18/10 13:18
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
Try isometric mode? Then you have no depth view and see the yellow at all times.


Click and join the 3dgs irc community!
Room: #3dgs
Re: Maths trig problem, angle to camera [Re: Joozey] #341610
09/18/10 16:28
09/18/10 16:28
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline OP
Serious User
MrGuest  Offline OP
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
Thanks again for trying!

Layer entities although I thought would make them appear flat still gives the same results.

Rotating in MED won't work as their position will be changed, the position at the front of the view won't always be as it is now.

Ideally I wanted the grid to be a perspective projection rather than isometric as there would be 1st person elements in it later.

I'll look at it again in a few days/weeks, hopefully something will inspire me.

Thanks again!

Re: Maths trig problem, angle to camera [Re: MrGuest] #341613
09/18/10 16:56
09/18/10 16:56
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
What if you don't use vec_for_screen and vec_to_screen, but simply the camera's position and rotation as reference?
To prevent the models from moving while the camera's tilt is changing, save the camera's initial rotation into a vector that you use for positioning the models.
Then switch between two states, one for placing a model, and the other for changing the camera's tilt, or whatever the other actions within the game are needed.

Re: Maths trig problem, angle to camera [Re: Pappenheimer] #341616
09/18/10 17:03
09/18/10 17:03
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Quote:
Ideally I wanted the grid to be a perspective projection rather than isometric as there would be 1st person elements in it later.


What do you mean, 1st person elements in the background of your grid?
If so, then you could use a second view that is ISOMETRIC to draw your grid without painting a background color using NOSKY. Then just put the view on top (layer > 0) of the camera view and you are done!


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Maths trig problem, angle to camera [Re: Superku] #341625
09/18/10 19:05
09/18/10 19:05
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Heres my idea of a layer-entity version.
Im pretty sure the angles are correct because the yellow parts are fully exposed.

BUT, it seems the angles required make the tiles look a little oddly-placed.
Here is the code I came up with.
(Ive chopped out almost all your original code and commented bits for ease of reading)
Code:
void hand_create(){
	
	while(int_gameState == gameState_change){ wait(1);	}
	
	int i;	for(i = 0; i < hand_max; i++)
	{
		ent_gameHand[i] = ent_createlayer("tile.mdl", NULL, NULL);
		vec_set(ent_gameHand[i].x, vector(500, sin(i*60)*180, cos(i*60)*180));
		ent_gameHand[i].pan  = atanv(ent_gameHand[i].y/ent_gameHand[i].x)-90;
		ent_gameHand[i].roll = 90+atanv(ent_gameHand[i].z/ent_gameHand[i].x);
		vec_fill(ent_gameHand[i].scale_x, 4.5);
		ent_cloneskin(ent_gameHand[i]);
	}
}



FYI :: Shadows dont appear on view entities either, I just noticed...



Last edited by EvilSOB; 09/18/10 19:06.

"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Maths trig problem, angle to camera [Re: EvilSOB] #341637
09/18/10 22:14
09/18/10 22:14
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline OP
Serious User
MrGuest  Offline OP
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
Originally Posted By: Pappenheimer
What if you don't use vec_for_screen and vec_to_screen, but simply the camera's position and rotation as reference?
Definately possible, it's what I initially tried before the vec_for_screen, but still had the same problems calculating the entities position relative to the cameras position and angle.

Originally Posted By: Superku
use a second view that is ISOMETRIC to draw your grid without painting a background color using NOSKY. Then just put the view on top (layer > 0) of the camera view and you are done!
Didn't know this was possible, going to try that after Evil's latest post.

Evil, thanks again for this, I was aware the entity would be slightly tilted inwards and it's almost perfect. Only problem with this is mouse_ent doesn't recognise view entities; I've tried resetting UNTOUCHABLE but still unfortunately didn't make any difference.

I'm going to try Superku's solution and hopefully won't have too great an impact on FPS. Thanks again.

Thanks all!

Page 2 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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