Camera and Polyvector

Previous topic - Next topic

Kyo

It's possible to use x_camera and polyvector???

hopefully you can give me an example of code?

thanks  :good:


MrTAToad

POLYVECTOR can only be used in a 2D environment, so after using 3D you need to use X_MAKE2D.  Something like :

Code (glbasic) Select
X_MAKE3D 0.1,1000.0,45.0
X_CAMERA 0.0,0.0,0.0,0.0,0.0,100.0
X_MAKE2D
STARTPOLY -1 // Bitmap = No.0
  POLYVECTOR  0,   0,  0,  0, RGB(255, 255, 255)
  POLYVECTOR   0, 300,  0, 64, RGB (255, 255, 255)
  POLYVECTOR 300, 300, 64, 64, RGB(255, 255, 255)
  POLYVECTOR 250,  50, 64,  0, RGB(  0, 255,   0)
ENDPOLY


Kyo

yes, but in this way the polyvector does not move when I move the camera.  ::)

aonyn

#3
Hi Kyo,

It sounds like you may want to use the X_Obj commands.
http://www.glbasic.com/xmlhelp.php?lang=en&id=113&action=view

These make polys in 3d space instead of 2d.
Usage example is in the link.

Or... you may be able to use X_Sprite
http://www.glbasic.com/xmlhelp.php?lang=en&id=140&action=view

Regards,
David

edit... You may also look at this option.
http://www.glbasic.com/forum/index.php?topic=7992.0
For by grace are ye saved through faith, and that not of yourselves: it is the gift of God: Not of works, lest any man should boast. -Ephesians 2:8-9

Kyo

Quote from: aonyn on 2014-May-13
Hi Kyo,

It sounds like you may want to use the X_Obj commands.
http://www.glbasic.com/xmlhelp.php?lang=en&id=113&action=view

These make polys in 3d space instead of 2d.
Usage example is in the link.

Or... you may be able to use X_Sprite
http://www.glbasic.com/xmlhelp.php?lang=en&id=140&action=view

Regards,
David

edit... You may also look at this option.
http://www.glbasic.com/forum/index.php?topic=7992.0

hanks for the help!
How I can do the flip (mirror??) of a X_Sprite?

kanonet

You cant, but you can fake it by using a mirrored sprite/texure.

BTW. maybe you also want to have a look at my X_SPRITE replacement here: www.glbasic.com/forum/index.php?topic=7992
Since you can flip texture coordinates, you can easily mirror your sprites with it.
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

Kyo

#6
Quote from: kanonet on 2014-May-13
You cant, but you can fake it by using a mirrored sprite/texure.

BTW. maybe you also want to have a look at my X_SPRITE replacement here: www.glbasic.com/forum/index.php?topic=7992
Since you can flip texture coordinates, you can easily mirror your sprites with it.

Great! It Work fine!  :nw:
How to make camera translation in X and Y... (not move camera or i change the angle of view)?

And it's possible to change colour at the texture with your system?????

kanonet

I dont understand what you mean with your question about camera translation, but you can alter the color of the sprite: search for the line
Code (glbasic) Select
libSPRITE::glColor4f( 1.0f, 1.0f, 1.0f, 1.0f );this one sets the color for all following sprites to white, but you can change it to an other color...
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

Kyo


Kyo

I do not understand why in Windows mode works fine, but in full screen creates a line that goes from top to bottom! (as if he was distorting the screen).
It happens with your system, but also with polyvector or drawsprite!

kanonet

Does this happen on every single GLBasic project that you create or only this one? Please try some really basic ones, maybe you can find out what commands are causing this.
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

MrTAToad

A screenshot will help too.

Kyo

#12
No no with all Project and in all PC.
I will try to make a screenshot or a video!

One other question, is there a way to parent the Quad (created with libsprite) to X_camera? To create a Hud!

Solved!
----------------------------------------------------
How to reutrn X or Y position of a 3D object????

kanonet

Quote from: Kyo on 2014-May-14No no with all Project and in all PC.
I will try to make a screenshot or a video!
Ok, then it must be a problem with one of the commands, or you do something wrong. Can you try to track it down a bit more?

Quote from: Kyo on 2014-May-14One other question, is there a way to parent the Quad (created with libsprite) to X_camera? To create a Hud!

Solved!
Hmm wouldnt 2D draws like Polyvectore etc. be perfect for a HUD?

Quote from: Kyo on 2014-May-14How to reutrn X or Y position of a 3D object????
I dont understand this, when you draw a 3D object, you tell it where to draw, so you already know its position! Or do you mean the X and Y position on screen? Then yes, you can transform world coordinates to screen coordinates with the command X_WORLD2SCREEN.
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

Kyo

#14
Quote from: kanonet on 2014-May-15
Quote from: Kyo on 2014-May-14No no with all Project and in all PC.
I will try to make a screenshot or a video!
Ok, then it must be a problem with one of the commands, or you do something wrong. Can you try to track it down a bit more?

Quote from: Kyo on 2014-May-14One other question, is there a way to parent the Quad (created with libsprite) to X_camera? To create a Hud!

Solved!
Hmm wouldnt 2D draws like Polyvectore etc. be perfect for a HUD?

Quote from: Kyo on 2014-May-14How to reutrn X or Y position of a 3D object????
I dont understand this, when you draw a 3D object, you tell it where to draw, so you already know its position! Or do you mean the X and Y position on screen? Then yes, you can transform world coordinates to screen coordinates with the command X_WORLD2SCREEN.


Sorry for my absence ...

In full screen mode not it's possible to make video or screen shot and in window mode it's work fine!

When I move the sprite on the screen, above the sprite, it creates a wave (similar to warp or image torn)...

I use your system kannonet, but i have the same problem with Z-Project ......

it also happens on Android (I do not know if even on iOS) ... but it's orrible to view ....

I think it's a GL_Basic rendering problem.

I don't use sprite (texture) powerX2 (64*64,128*128 ecc).

I test various resolutions but the problem persists

The updates of GL_Basic are stop for long time!

I hope Gernot can fix this problem or is useless for me to continue to use GL_B!  :( :'(