BASIC

Author Topic: Camera and Polyvector  (Read 16406 times)

Offline Kyo

  • Dr. Type
  • ****
  • Posts: 350
    • View Profile
Camera and Polyvector
« on: 2014-May-13 »
It's possible to use x_camera and polyvector???

hopefully you can give me an example of code?

thanks  :good:


MrTAToad

  • Guest
Re: Camera and Polyvector
« Reply #1 on: 2014-May-13 »
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

Offline Kyo

  • Dr. Type
  • ****
  • Posts: 350
    • View Profile
Re: Camera and Polyvector
« Reply #2 on: 2014-May-13 »
yes, but in this way the polyvector does not move when I move the camera.  ::)

Offline aonyn

  • Mr. Polyvector
  • ***
  • Posts: 136
    • View Profile
Re: Camera and Polyvector
« Reply #3 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
« Last Edit: 2014-May-13 by aonyn »
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

Offline Kyo

  • Dr. Type
  • ****
  • Posts: 350
    • View Profile
Re: Camera and Polyvector
« Reply #4 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?

Offline kanonet

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1142
    • View Profile
    • My GLBasic code archiv
Re: Camera and Polyvector
« Reply #5 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.
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

Offline Kyo

  • Dr. Type
  • ****
  • Posts: 350
    • View Profile
Re: Camera and Polyvector
« Reply #6 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?????
« Last Edit: 2014-May-13 by Kyo »

Offline kanonet

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1142
    • View Profile
    • My GLBasic code archiv
Re: Camera and Polyvector
« Reply #7 on: 2014-May-14 »
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

Offline Kyo

  • Dr. Type
  • ****
  • Posts: 350
    • View Profile
Re: Camera and Polyvector
« Reply #8 on: 2014-May-14 »
thanks  :nw:

Offline Kyo

  • Dr. Type
  • ****
  • Posts: 350
    • View Profile
Re: Camera and Polyvector
« Reply #9 on: 2014-May-14 »
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!

Offline kanonet

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1142
    • View Profile
    • My GLBasic code archiv
Re: Camera and Polyvector
« Reply #10 on: 2014-May-14 »
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

  • Guest
Re: Camera and Polyvector
« Reply #11 on: 2014-May-14 »
A screenshot will help too.

Offline Kyo

  • Dr. Type
  • ****
  • Posts: 350
    • View Profile
Re: Camera and Polyvector
« Reply #12 on: 2014-May-14 »
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????
« Last Edit: 2014-May-14 by Kyo »

Offline kanonet

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1142
    • View Profile
    • My GLBasic code archiv
Re: Camera and Polyvector
« Reply #13 on: 2014-May-15 »
No 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?

One 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?

How 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

Offline Kyo

  • Dr. Type
  • ****
  • Posts: 350
    • View Profile
Re: Camera and Polyvector
« Reply #14 on: 2014-May-20 »
No 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?

One 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?

How 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!  :( :'(
 
« Last Edit: 2014-May-20 by Kyo »