Discussion forum about PANORAMIC language

Mac, Windows & Android application development with PANORAMIC language
 
HomeFAQSearchRegisterMemberlistUsergroupsLog in
Latest topics
» Hello world.
by Mon Jun 19, 2017 1:37 am

» Biomorphes de PICKOVER
by Sun Jun 18, 2017 2:33 am

» In less than 10 lines of code
by Fri Jun 16, 2017 5:03 am

» Effect Dopler
by Fri Jun 16, 2017 3:29 am

» SuperEllipse
by Wed Jun 14, 2017 4:01 am

» Plants
by Wed Jun 14, 2017 3:38 am

» Mira's attractor
by Wed Jun 14, 2017 3:30 am

» Triangle of Sierpinski
by Wed Jun 14, 2017 3:22 am

» Esthétique polaire
by Wed Jun 14, 2017 3:16 am

» Butterfly effect : Lorenz equations
by Wed Jun 14, 2017 3:08 am

» Collision detection
by Tue Jun 13, 2017 5:09 am

» The Bees Laline Paull Epub Books
by Mon Oct 10, 2016 8:58 pm

» PANORAMIC for Mac OSX 10 is available
by Tue Aug 09, 2016 6:08 pm

» ide
by Sat Jul 16, 2016 12:27 am

» Can I change the program icon/logo in my application ?
by Thu Jul 07, 2016 3:32 am

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Share | 
 

 3D collision

View previous topic View next topic Go down 
AuthorMessage
zwikl



Number of posts : 2
Registration date : 2010-02-28

PostSubject: 3D collision   Sun Feb 28, 2010 5:55 pm

hi, i managed to create a 3D world with movement etc.
now the question, whats the best way to check collisions.
I'm very happy bout panoramic, great work. And excuse my english, i'm from austria. ^^
move the mouse to change the angel and use arrow keys to move.

dim kamerax,kameray,kameraz
dim aimedx,aimedy,aimedz
dim dxx,dxy:dxx=800:dxy=600:rem *****größe für das 3D Fenster
dim Kamerasichtwinkel

scene3d 1
height 1,dxy
width 1,dxx
color 1,0,0,0
width 0,1024 :rem ***********0 = form
height 0,768
rem ***** Dungeon kreiren *******************************************************
dim dungeonmaxx, dungeonmaxy, dungeonmaxz
dungeonmaxx = 10: dungeonmaxy = 0: dungeonmaxz = 10

dim x,y,z :rem *****für die aktuellen Positionen
dim anzahl_3d_Objekte:anzahl_3d_Objekte = 1
dim aktuellerinhalt
for z = 0 to dungeonmaxz
for y = 0 to dungeonmaxy
for x = 0 to dungeonmaxx
aktuellerinhalt = int(rnd(1)*2)
if aktuellerinhalt = 1
3d_box anzahl_3d_Objekte,1,1,1
3d_x_position anzahl_3d_objekte,x
3d_y_position anzahl_3d_objekte,y
3d_z_position anzahl_3d_objekte,z
end_if
anzahl_3d_objekte = anzahl_3d_objekte + 1
next x
next y
next z


rem ----main-------------------------------------------
while scancode <> 27
rem ****** nach vorne (Pfeil oben) *****
if scancode = 38
kameraz = kameraz + (sin(kamerasichtwinkel*3.1415/180))/100
kamerax = kamerax + (cos(kamerasichtwinkel*3.1415/180))/100
end_if
rem ***** nach hinten (Pfeil unten) *****
if scancode = 40
kameraz = kameraz - (sin(kamerasichtwinkel*3.1415/180))/100
kamerax = kamerax - (cos(kamerasichtwinkel*3.1415/180))/100
end_if
rem ***** nach links (Pfeil links) *****
if scancode = 37
kameraz = kameraz + (sin((kamerasichtwinkel-90)*3.1415/180))/100
kamerax = kamerax + (cos((kamerasichtwinkel-90)*3.1415/180))/100
end_if
rem ***** nach rechts (Pfeil rechts) *****
if scancode = 39
kameraz = kameraz + (sin((kamerasichtwinkel+90)*3.1415/180))/100
kamerax = kamerax + (cos((kamerasichtwinkel+90)*3.1415/180))/100
end_if
rem ******nach links drehen********
if mouse_x_position(1) < dxx/4
kamerasichtwinkel = kamerasichtwinkel - .1
if kamerasichtwinkel < 0 then kamerasichtwinkel = 360
end_if
rem ******nach rechts drehen*****
if mouse_x_position(1) > 600
kamerasichtwinkel = kamerasichtwinkel + .1
if kamerasichtwinkel > 360 then kamerasichtwinkel = 0
end_if

aimedx = kamerax+cos(kamerasichtwinkel*3.1415/180)
aimedz = kameraz+sin(kamerasichtwinkel*3.1415/180)
cam_position kamerax,kameray,kameraz
point_position aimedx,aimedy,aimedz

print_locate 0,dxy
print " "
print " "
print_locate 0,dxy
print "kameraxpos: ";kamerax
print "kamerazpos: ";kameraz

end_while
terminate
Back to top Go down
View user profile
zwikl



Number of posts : 2
Registration date : 2010-02-28

PostSubject: Re: 3D collision   Sun Mar 07, 2010 12:16 pm

is there anybody out there?
Back to top Go down
View user profile
Severin



Number of posts : 19
Localisation : Germany/Braunschweig
Registration date : 2010-12-13

PostSubject: Re: 3D collision   Sat Mar 30, 2013 7:59 am

****************************************
PANORAMIC V 0.9.24 ist verfügbar
PANORAMIC V 0.9.24 is available
PANORAMIC V 0.9.24 est disponible
PANORAMIC V 0.9.24 es disponible

Das Forum Panoramic ist wieder aktiv.
Bitte besucht uns.

The forum Panoramic is active again.

Please, visits us.

Le forum Panoramic est actif de nouveau.

S'il vous plaît, nous visite.

El foro Panoramic es de nuevo activo.

Por favor, nos visita.
********************************************
Back to top Go down
View user profile
Sponsored content




PostSubject: Re: 3D collision   

Back to top Go down
 
3D collision
View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Discussion forum about PANORAMIC language :: Panoramic for Windows :: Source code (snippets)-
Jump to: