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.

AppGameKit Classic Chat / How to draw 3d object to 2d scene?

Author
Message
Alex_Peres
AGK Master
15
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 26th Apr 2016 15:08 Edited at: 26th Apr 2016 16:00
How to draw 3d object to 2d scene?
I mean how to define right coordinates from 3d world to 2d scene?
Thanks.
haliop_New
User Banned
Posted: 26th Apr 2016 17:27
I think the best idea is to actually use 2d plains as your 2d stuff rather then sprites then your whole world is 3d but looks 2d like you aimed to...

However you could look at the help file search for getting screen coords from 3d and vice versa so youll get the exact 2d screen coordinates from your 3d object position ...
Alex_Peres
AGK Master
15
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 27th Apr 2016 12:15 Edited at: 27th Apr 2016 12:25
The game is almost completed with 200'000+ lines of code. Using 2d plains it is not suitable for me at all! It's the same if you advise me to use Unity instead of AGK... lol
I have a kind of isometric game made with sprites and I want to to put into it a butterflies using animated 3d-object, so how can I do whis with best and fastest(for gpu) way?
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 27th Apr 2016 14:22
Quote: "Get3DVectorXFromScreen

Description

Converts a 2D point on the screen into a vector pointing into the 3D world. The vector is normalised to 1 unit long, to extend it into the world simply multiply it by your desired distance.

Definition

float Get3DVectorXFromScreen( x, y )

Parameters

x - The X component of the screen position.
y - The Y component of the screen position."

From the help files...
Alex_Peres
AGK Master
15
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 27th Apr 2016 14:46
Muchos gracias! I'll try this.

Login to post a reply

Server time is: 2024-11-25 07:32:34
Your offset time is: 2024-11-25 07:32:34